Open tibineagu opened 4 months ago
if your haystack is just an array of strings, you can try uFuzzy with interLft: 2
:
https://leeoniya.github.io/uFuzzy/demos/compare.html?libs=uFuzzy&search=mana&interLft=2
@leeoniya thanks for the reply. it's not, it's usually a set of { text, value }
objects.
as long as there's 1:1 mapping and you're searching just text
you can still do it. uFuzzy will just give you back matched idxs. so use Array.map to build a haystack from your objects that's [text0, text1, text2,...]
and then use the matched idxs to pull value
out of the original array/objects.
This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days
Is there an existing issue for this?
Your question
Hi @krisk - First off, thanks for all the amazing work you've been doing with this library. We've been using it for the better part of a decade now!
We've recently found ourselves in the position of using the searcher with a rather unorthodox set of requirements.
Here's an example:
"Emanation ..." should not be included because the pattern is not at the beginning of the word.
While I can make
threshold: 0
to disable fuzzy search, and setignoreLocation: true
to search the entire string, I am not sure what i need to do to tell the searcher that i only need matches at the beginning of a word.Any help would be greatly appreciated!