question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Matcher for auto complete

See original GitHub issue

I’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:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
markvitalcommented, Mar 23, 2016

anyway, would love to have this implemented anytime soon

0reactions
olivernncommented, Apr 11, 2016

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found