Closed diego898 closed 6 years ago
@diego898 Thanks for the report - that's a great idea! I'll whip that up when I have a moment.
And thanks for the links to the discussions about goings on in core TW - I'll check that out!
@diego898 Thanks again - I've released 1.0.1 and pushed it to https://hoelz.ro/files/fts.html. Please let me know if it works for you!
Hey @hoelzro! Thanks it looks like its working and I can now fuzzy search!!!
Just a side note: It might be nice to automatically switch to fuzzy matching if no matches are found. What do you think?
@diego898 So add some default fuzz distance to search terms upon no matches, assuming that the user mispelled a word?
Not necessarily a misspelling, but more than likely yes. In fuzzy matching mispelling can be used a feature. For example, I use
https://github.com/junegunn/fzf
multiple times daily. As an (extreme) example, I can lazily type: dp lrng pdf
to find all pdfs with deep learning
in their names.
Hmm...I'm kind of on the fence on the fuzzy search thing. I like the idea, but it feels like it might be better suited to its own plugin.
Sorry Rob, what do you mean its own plugin? lunr is the library handling the fuzzy search. With this plugin right now we can do fuzzy search. I was just suggesting adding (perhaps through a configurable option) that when no results are found, the search is automatically run again with a ~1
attached for fuzzy searching.
I meant having that "fuzzy fallback" live in its own plugin, but I don't know how that would work =/ Maybe I should just add it and try it out as an idea!
Hello again!
I came across this section in the documentation:
https://lunrjs.com/guides/searching.html#fuzzy-matches
and when I tried to change my search string by typing the
~
character I got a series of uncaught errors. If I just press ok and continue until I get the number in likesearchString~2
and press Ok a couple more times to some errors, I am actually able to perform the fuzzy matching.If I just paste in the query with the
~2
attached, I dont get any errors.Perhaps some error catching could be implemented to ignore this problem as you type character by character?
Also, just wanted to let you know of this discussion google groups where Jeremey mentions trying to incorporate lunr.js! And also this feature request on the tiddlywiki main repository: https://github.com/Jermolene/TiddlyWiki5/issues/3233 where I am also trying to get something like this in the core!