dragonflagon-fvtt icon indicating copy to clipboard operation
dragonflagon-fvtt copied to clipboard

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

Open jocolamarco opened this issue 2 years ago • 6 comments

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

jocolamarco avatar Aug 25 '21 21:08 jocolamarco

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 avatar Aug 27 '21 00:08 flamewave000

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 avatar Oct 15 '21 16:10 flamewave000

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

flamewave000 avatar Feb 12 '22 18:02 flamewave000

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

dmrickey avatar Feb 14 '22 15:02 dmrickey

@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.

flamewave000 avatar Feb 15 '22 15:02 flamewave000

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

dmrickey avatar Feb 15 '22 16:02 dmrickey