flamewave000 / dragonflagon-fvtt

DragonFlagon FoundryVTT Modules
BSD 3-Clause "New" or "Revised" License
64 stars 62 forks source link

DF Settings Clarity: Improve search by adding option of exact word search #178

Open jocolamarco opened 3 years ago

jocolamarco commented 3 years ago

Is your feature request related to a problem? Please describe. Typing a word to search for it in settings, searches for all individual letters

Describe the solution you'd like Type word to get fuzzy search Type "word" to get exact match search

Describe alternatives you've considered (Optional) workaround is manual scrolling to find what matches the search

Additional context (Optional) image

flamewave000 commented 3 years ago

This is reasonable, and something I'd probably like to have as well. I'll see if I the Fuzzy Search library I use can perform this :+1:

flamewave000 commented 3 years ago

Unfortunately the fuzzy-search library I use does not support exact word matching. I've opened a ticket with that project and hopefully they will improve the library at some point.

Ticket: https://github.com/farzher/fuzzysort/issues/87

flamewave000 commented 2 years ago

So the author of the Fuzzy Sort library has provided a work around for this. I can try to implement this in DFSC.

dmrickey commented 2 years ago

Copied from my closed issue:

Does the fuzzy search not return a score to indicate how likely of a match it is? I'd expect those results above to have a pretty low score.

I just clicked through to the issue you linked, to the referenced package and it looks like it does return a score, so if it does return sane values, only showing results with a minimum score of "something" might be a good option

flamewave000 commented 2 years ago

@dmrickey It does indeed return a score, and I am currently using a score threshold for it, but the scoring is very finicky and I had to use some trial and error as the score is not linear and can be a little unpredictable. So to prevent many false negatives, I used a slightly more conservative score limit.

dmrickey commented 2 years ago

I don't know what to say other than the result in the image above is simply not useful. If the only option with fuzzy search is to use a low score and have the results as pictured above, then I'd rather just have an exact search and get exactly what I typed in. Like, if I'm always going to have to type in quotes to get the search to work because fuzzy search results aren't useful, then I'd rather just have the default be quotes because at that point quotes are basically required and just extra keystrokes that are always necessary