Page 1 of 1

fuzzy finder for live filter

Posted: 07 Aug 2020 07:46
by xyzplorer
fzf, or fuzzy finder is a famous application in linux that filters strings with a "fuzzy search algorithm"
https://github.com/junegunn/fzf
This is implemented in some other software too, for example, https://levelup.gitconnected.com/fuzzy- ... 09c0f3ce9a

I think it will be great if the live filter box does the fuzzy search as fzf. I find it very convenient and ergonomic. A good thing is that even if I miss some characters in a filename, the fuzzy search will still list the file as a match. For example, if I type "notpad", it will still list "notepad.exe".

It seems that this algorithm (or something similar to it) is the default search algorithm implemented in "fman"(https://fman.io), a file explorer like xyplorer. Please try it and find out how it is convenient! Since I've been already using xyplorer, I want this feature to be implemented in xyplorer too.

Re: fuzzy finder for live filter

Posted: 07 Aug 2020 07:53
by highend
Changelogs
v19.50.0229 - 2019-01-17 11:36
v20.60.0007 - 2019-11-24 12:40
; Tweak: bit field: 1 = shotgun in main LFB, 2 = shotgun in LFBs in dialogs, 4 = shotgun in dropdown match list, 64 = fat gun in LFBs in dialogs
LiveFilterIsShotgun=0
https://www.xyplorer.com/faq-topic.php?id=tweak

Moved...

Re: fuzzy finder for live filter

Posted: 07 Aug 2020 22:35
by admin
Fuzzy search is available in Find Files, but currently not in Live Filter:

Code: Select all

v15.00.0001 - 2015-03-10 13:06
    + Find Files: Now you can invoke a fuzzy search (and set the degree of 
      fuzziness) by appending the new switch "/fuzzy=n" to the search term in 
      the name field. The "n" stands for the fuzziness and can be a value from 0 
      thru 100. Value 0 is equivalent to non-fuzzy so it's the same as omitting 
      the whole switch.
      Examples:
        Poper.png /fuzzy=20   matches "Paper.png"
        Koln.txt /fuzzy=10    matches "Koeln.txt"
        Koln.txt /fuzzy=100   matches everything
      Notes:
      - The similarity measurement of XYplorer's fuzzy search is based on the 
        Ratcliff/Obershelp pattern recognition algorithm (Ratcliff 1988), also 
        known as "gestalt pattern matching".
      - Of course, the switch can also be applied to a Quick Search. This was 
        not possible before.

Re: fuzzy finder for live filter

Posted: 07 Aug 2020 23:36
by highend
The implementation in fman is not fuzzy search based like in XY.

Create a folder named Paper, navigate into it once, open the goto palette (ctrl+p) and type "poper". "Paper" won't be listed.

Re: fuzzy finder for live filter

Posted: 08 Aug 2020 14:39
by xyzplorer
This is still a feature request, as fuzzy search is not implemented in live filter box, and the main post specifically mentions live filter. Can this be moved to the original section (Wishes)?

Also, after trying, I found that the fuzzy search algorithm implemented in xyplorer is much different than software I've mentioned: fzf, vscode, fman... so it is still a feature request!

Re: fuzzy finder for live filter

Posted: 08 Aug 2020 14:50
by highend
as fuzzy search is not implemented in live filter box
What kind of fuzzy search do you mean exactly? Ratcliff/Obershelp pattern recognition algorithm (Ratcliff 1988)?
This is not what fman is using and you were referring to it as "how it should work"

And additionally "notpad" which should find "notepad" because your requested "fuzzy search" works this way...

This is exactly what the tweaks are providing^^
2020-08-08_144941.png

Re: fuzzy finder for live filter

Posted: 08 Aug 2020 15:17
by admin
Äh, is that pic a mockup?

Re: fuzzy finder for live filter

Posted: 08 Aug 2020 15:18
by highend
No, why?

Re: fuzzy finder for live filter

Posted: 08 Aug 2020 15:22
by admin
How did you get the fuzziness into it?

Re: fuzzy finder for live filter

Posted: 08 Aug 2020 15:24
by highend

Code: Select all

LiveFilterIsShotgun=65
while (ofc) =1 should work for LFB as well...

Re: fuzzy finder for live filter

Posted: 08 Aug 2020 15:29
by admin
ok, <facepalm>

But that's not fuzziness. I could add optional fuzziness to LFB, of course, somehow...

Re: fuzzy finder for live filter

Posted: 08 Aug 2020 15:35
by highend
What the mentioned tools provide is a fuzzy search but afaik it's just how they call their (regex) implementation.
Ratcliff 1988 is definately not used in e.g. fman, otherwise the "poper / paper" example would work.

In my original request for it (viewtopic.php?f=5&t=17101)
I've asked for a more sophisticated way (regex - that's what the mentioned tools use as well) but I live with your implementation since years and it's good enough for 99% of all cases and even more powerful since you've added the boolean fatgun option.

Re: fuzzy finder for live filter

Posted: 10 Aug 2020 09:23
by xyzplorer
LiveFilterIsShotgun=65 looks good! I didn't know that such a setting that is not accessible via the configuration dialog is available. It mostly suits my habbit of using other tools that uses fuzzy search.

There is another feature request regarding using "shotgun" in LFB. Currently the live filter search result is sorted in alphabetical order. It would be great if it implements some sort algorithm: For example, when searching for "abc", result "adbc" should be located higher (or is selected by default) than "axxxxbyyyyyyc". That's what "fzf" does, it automatically selects the most relevant result by default.

Re: fuzzy finder for live filter

Posted: 10 Aug 2020 10:39
by admin
Cool idea but that kind of sorting is not possible here I'm afraid. The shotgun algorithm just returns match or no match, not any degree of similarity.