Closed trusktr closed 4 years ago
I suppose since it is a matching terms, and there is not word shep
on the page, it would not show any results.
Instead we can use wildcard matching shep*
, in which case it matches Shepard
. ref
Ah, I see! Most website searches that I know of work more like a fuzzy finder, which I believe many people expect.
A few examples:
Is there an option to enable fuzzy search?
Yes it supports fuzzy search like this shep~1
where 1 is the edit distance. More details here
The demo site is intended only to be able to demo the features of Lunr. The input entered in the search box is passed straight to lunr.Index#search
. This doesn’t add any implicit wildcards or any other modifiers as already mentioned.
You’re right that in many cases wildcard or fuzzy searching would be a user’s expectation. Using lunr.Index#query
it is possible to have that level of control on how a query is interpreted.
reproduce:
And similar with other searches.
Screenshot: