Author Topic: A Fuzzy Search  (Read 5041 times)

WannaBee

  • Full Member
  • ***
  • Posts: 174
Hi everybody :)

First, my apology if this request has been covered before, or is already implemented, yet to be be discovered by myself.

Please, could we see a Fuzzy Search function implemented in a future iteration of MusicBee? Many times have I missed a search target through misspelling, and something easy to work with here will sure be boon.

Thanks.

Zak

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2553
I'm not sure what kind of fuzzy searches you're suggesting, but remember the less you type, the more you'll match.

The example on the Fuzzy Search page suggests "Misissippi " as a misspelling worth correcting. If I wasn't sure how to spell it, rather than guessing, I'd type "Mis ipp". A misspelling will obviously match nothing, but by only showing tracks containing both those terms MusicBee quickly shows "Mississippi Kid" by Lynyrd Skynyrd.

You might not always be able to narrow the list down to just the one track or album you want but it should be easy to narrow it down enough, even in a library with tens of thousands of tracks.
Bee excellent to each other...

WannaBee

  • Full Member
  • ***
  • Posts: 174
I'm not sure what kind of fuzzy searches you're suggesting, but remember the less you type, the more you'll match.
[...]

There are two 'fuzzy search' methods which I have found very suitable, which are functions of two well-known Windows applications, namely explorer2 and Wordweb:

1. The first applies a percentile system to score a search hit- for e.g. choose 100% for a perfect match, varying down (usually in 10%-decrements) to as low as you want go for a lower, less accurate hit. How this is structured, I do not know.

2. The second, used by Wordweb, is really super, as it provides a more advanced way to get the result you want. It will allow you to search any word by using the following dummy letters:

? Any letter.
* Any number of letters including no letters.
@ A vowel
# A consonant

You can combine ? and *, for example ??* represents “at least two letters”.

Examples

T???SH finds thrash, thresh and thrush
*GRY finds angry, hungry and unangry
?*Q*P finds acquaintanceship, equip, liquid soap, re-equip, and square up
Last Edit: February 18, 2015, 11:00:41 AM by WannaBee

psychoadept

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10940
The second form of search sounds like a simplified version of regex (regular expressions).  You can tell MB to use regex in the custom search dialog.  So you could search "any field", "match regex", etc.

It's a little extra work vs using the basic search box, of course, but the function is there.  And you can find lots of documentation on regex.  I recommend http://www.regexr.com/

Having a regex toggle in the menu for the.main search.box would be pretty.awesome, come.to.think of it.
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest patches
(Unzip and overwrite existing program files)

WannaBee

  • Full Member
  • ***
  • Posts: 174
Why not keep it simple, the way it is described with the four basic operators (?, *, @, #)-- eliminating the need to shoulder the extra burden of learning the regex?

Pingaware

  • Sr. Member
  • ****
  • Posts: 1111
I'd say because RegEx is a widely adopted system with extensive documentation and ultimately a lot more power than your suggestion.
Bold words in my posts are links unless expressly stated otherwise.

psychoadept

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10940
Also, you can do most of what you described with very similar searches.  Here are the same searches using regex:

T???SH = T...SH
*GRY = .*GRY
?*Q*P =..*Q.*P

. = any character
* = 0 or more of the preceding character
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest patches
(Unzip and overwrite existing program files)

WannaBee

  • Full Member
  • ***
  • Posts: 174
True, but you still need to learn and use regex.

Zak

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2553
It seems excessive where the goal is just to find a selection of tracks or albums. I can't imagine any scenario where someone wants a list of tracks containing the words acquaintanceship, equip, liquid soap, re-equip, or square up in their title.

Why not keep it simple, the way it is described with the four basic operators (?, *, @, #)-- eliminating the need to shoulder the extra burden of learning the regex?

That might seem simpler as a user but if this is implemented it will almost certainly be using regular expressions, because MusicBee already supports it (i.e. the code already exists).

To use anything else Steven would need to write his own interpreter which would end up being transformed into regular expressions anyway, creating extra work for no benefit.
Bee excellent to each other...