AnthonyDiGirolamo / todotxt-machine

an interactive terminal based todo.txt file editor with an interface similar to mutt
https://pypi.python.org/pypi/todotxt-machine/
GNU General Public License v3.0
244 stars 37 forks source link

search doesn't yield expected results #53

Open wolterhv opened 6 years ago

wolterhv commented 6 years ago

It seems that the search function yields strings, which 1) have all the characters in the search string and 2) in the same order they appear in the search string, instead of exact hits of the search string.

For example, "sho[w assembly instructions for bicycles +idea +proj]ects" is currently a valid hit for the search string woeij, where the text within the square brackets would be the hit itself.

WPettersson commented 6 years ago

This is by design, although whether it's a good or bad design idea is debatable. The website uses the term "fuzzy search matching", which is implemented exactly as you say. I'm tempted (in my fork) to change this to what I call "fuzzy word search", which means match all of the words, in some order, but match each word completely.

AnthonyDiGirolamo commented 6 years ago

This needs some work. When I originally wrote it I was only familiar with fuzzy matching and regulary used it in vim. Now I'm more used to this style: http://oremacs.com/swiper/#ivy--regex-plus That adds wildcards at the location of spaces in the search string.

I will plan to add custom search matchers. Literal text, fuzzy, and the regex-plus method described in the above link.

On Fri, Jun 1, 2018, 7:10 AM William Pettersson notifications@github.com wrote:

This is by design, although whether it's a good or bad design idea is debatable. The website uses the term "fuzzy search matching", which is implemented exactly as you say. I'm tempted (in my fork) to change this to what I call "fuzzy word search", which means match all of the words, in some order, but match each word completely.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AnthonyDiGirolamo/todotxt-machine/issues/53#issuecomment-393892417, or mute the thread https://github.com/notifications/unsubscribe-auth/AACTMc_NscUurzWMAFyetCc_1yCKtVpUks5t4Us7gaJpZM4Sw9PF .