Home > Mobile >  Basic elasticsearch autocomplete
Basic elasticsearch autocomplete

Time:01-04

I am trying to set up autocomplete for my elasticsearch cluster. The field I want to use is a text field with journal titles. I tried to use the 'standard' completion suggester field type in elasticsearch, but it used too much memory so I had to disable it.

In the meantime I would like to get something basic working, such that someone typing "science" would get a list of suggestions like "science in religion", "science experiments". Then when they type "science in" they would get "science in religion".

I guess this is just a match_phrase query and I can limit it to the top 10 results? Or there is a way to do term frequency across the index?

CodePudding user response:

You can experiment with match_phrase, match_phrase_prefix, prefix over a keyword, and edge n-grams as well. Each of these work well for different use cases.

  •  Tags:  
  • Related