Matcher for auto complete
See original GitHub issueI’m looking for simple search enigine, with metadata support. It would be great to have a matcher in Lunr.js, so it can be integrated with auto complete, like typeahead.js. Something like this:
idx.match("lo")
..
idx.match("lov")
..
idx.search("love")
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top Results From Across the Web
auto complete exact match from start using jquery ...
The way to do this is documented at http://api.jqueryui.com/autocomplete/ ... response ) { var matcher = new RegExp( "^" + $.ui.autocomplete.
Read more >Autocomplete | Pattern Matching Demonstration - YouTube
This video applies to Update 22A and later releases. In this video you will learn pattern matching.
Read more >Autocomplete design pattern
Suggest possible matches for a search as users are typing. The Autocomplete pattern is a predictive, recognition based mechanism used to assist ...
Read more >Elasticsearch Autocomplete Guide
Autocomplete can be achieved by changing match queries to prefix queries. While match queries work on token (indexed) to token (search query tokens)...
Read more >Automatic completion | JetBrains Rider Documentation
The best match in the auto-completion popup can be pre-selected either with hard or with soft selection: Hard selection (blue in most color ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
anyway, would love to have this implemented anytime soon
@missinglink thanks for the comment, some interesting things to think about. If you have a link or similar on the technique you mentioned using sparse bit masks I’d be really interested to read up on it. While having 200MM records in a browser is probably pushing what is a sensible use case for lunr, I’m sure there are things I could learn anyway!
You’re right in that actually getting a performant and accurate auto-complete engine is a task in itself. You can certainly get pretty far by bending lunr in the ways mentioned, and for a lot of people it will cover the 90% of cases, but there is certainly scope for something more focused on the task at hand.
The two cases that you mention, where the original token is missing in the output, is because they are stop words. Removing the stop word filter would solve this particular issue, alternatively you could just use the
lunr.TokenStore
object directly, without ever creating an index.@markvital between my previous answer and the detailed comments from @missinglink there should be enough for you to put together your own implementation to solve your problem. If you do get something working, either with lunr or some other implementation, please do update this issue so others might benefit.