I have a books index which contains an array of tags (with both text/keyword types), i'd like to offer an autocomplete for tags so users type "ro" and it returns "romance" or "rock and roll".
This is not entirely trivial to do with the aggregations API. Have you considered using the completion suggester instead? It was designed for this exact use case.
The advantage of the completion suggester is that it will load the suggestions in memory. As a result, the suggestions will be returned really quickly; typically faster than a query using edge ngrams would do.
I failed using Highlighting in Completion Suggestion, Comparison of different methods for autocompletion also mentions that Completion Suggester fails to support Highlighting. Is there a way to overcome this issue?
Edge ngram fails to suggest when searching with terms containing symbols. I know whitespace analyzer will solve this issue while using it in different query. how do i mention "whitespace" tokenizer within edge ngram custom analyzer.
Just replace "tokenizer": "standard" in that example with "tokenizer": "whitespace" (and of course apply the filters that you want to use instead of those in the example).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.