What is the best way to build an auto complete

Hello friends

What is the best way to build an auto complete program in terms of performance ??

Also consider that I want to prioritize information whose names start with the text that the user is searching for.

Hi Amir,
The new terms enum api may be of interest

1 Like

Is the performance of _terms_enum in data around 50 GB to 100 GB or more better than ngram + wildcard or search as you type or suggesters?

And should the field type be keyword type or some other special type?

It uses the search index directly to quickly look up values in the sorted list of unique terms held in the index. This cost can be independent of number of docs.

So it means it has better performance, right ??

And that given that it should only be the keyword field type

How to use the analyzer?

We've had solutions before that use in-memory FSTs which are fast but have to be declared up-front with a special index and can cost a lot of RAM.
The terms_enum api is new and doesn't any required special structures. I haven't benchmarked

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.