Allow "like" search query
regisphilibert opened this issue · comments
Currently using this list of items:
- V1001
- P1001
- 1001
- Basic
and entering100
in the search field, only1001
will be returned.
When entering `asic, Basic wil not be returned.
I have looked #28 but could not find the proper "token" for what I am looking for.
I wonder if there is a configuration setting allowing the like searchers.
I've tried wrapping the query value between *
à la Lurnr.js but I think those are escaped by ItemsJS.
Thanks.
The idea seems useful. Is the like feature '*' supported by lunr.js ?
There is a notion of wildcards
if this can help: https://lunrjs.com/guides/searching.html
Thanks. We'll need to upgrade Lunr.js from 1.0 to the newest 2.x soon. Fortunately API seems almost the same https://lunrjs.com/guides/upgrading.html so upgrading should not be a problem.
Additional features will be available by default then i.e. wildcard, boosting or searching by field
One change which I see will be:
The behaviour of the search has changed slightly, multi-term searches are now combined with OR, where they used to be combined with AND.
Practically this change means that a given search will return more documents in 2.x than it did previously, with the most relevant results returned first.
Not sure yet if this change will be good or not
@regisphilibert you can use Lunr 2.x (or plenty of others) by custom integration. Example is here https://github.com/itemsapi/itemsjs/blob/master/docs/lunr2-integration.md. Thanks to that you have full control over search features (wildcards, etc)