nextapps-de / flexsearch

Next-Generation full text search library for Browser and Node.js
Apache License 2.0
12.53k stars 491 forks source link

return one if exact match? #440

Open cellulosa opened 5 months ago

cellulosa commented 5 months ago

heya thanks for the great library.

consider the following scenario:

titles to search:

currently, if I search for titl I get both. Also If I search for title I get both, but in this instance there is an exact match. Is it possible to tweak the settings to return only the exact match, if found?

I can obviously add a logic outside of the search, but I was wondering if there is a flexsearch way of doing this.

Thanks

kunal-singh commented 3 months ago

Have you tried tokenize:"strict" while initialising the index?

Here it is in the documentation.