tantivy
tantivy copied to clipboard
Support for autocompletion
Is your feature request related to a problem? Please describe. Modern search engines have a functionality called autocompletion. For example, when user types in "tan", the search engine suggest the word "tantivy"; when user types in "tantivy", the search engine suggest the phrase "tantivy search engine". For frontend, this is often seen as a drop down list below the search area.
Lucene has a module Lucene suggest which provides such functionality.
Describe the solution you'd like Implement a module which provides such functionality.
That could be interesting. If someone wants to work on this, contributions are welcome.
Just some thoughts on this, and possible implementation directions:
Create a new GUI that simply renders the results differently
You can use tantivy as it functions right now, and just re-imagine your front end. Maybe you'll need to introduce a second endpoint or add a query param for autocomplete requests, as you may want shorter pages, more fuzziness, and less data.
For many usecases (e.g. searching in a helpdesk), this may be what you actually want - it simply helps users find relevant content in less interactions.
Index / persist previous queries
We can store the queries that were performed before, and search in these to make suggestions.
Autocomplete words based on indexed words
I think tantivy already makes indexes by words. We can probably perform range queries over these, and sort these by how many times they occur.
Make recommendations based on word distance
If two words often occur near to each other, we can use that information to make predictions.