Is it possible to use Spring's annotations to define Completion Suggester for a mapping in Elasticsearch? Is it possible to use Spring's annotations to define Completion Suggester for a mapping in Elasticsearch? elasticsearch elasticsearch

Is it possible to use Spring's annotations to define Completion Suggester for a mapping in Elasticsearch?


Absolutely yes..

you can configure your entity like this:

...import org.springframework.data.elasticsearch.core.completion.Completion;...@Document(indexName = "test-completion-index", type = "annotated-completion-type", indexStoreType = "memory", shards = 1, replicas = 0, refreshInterval = "-1")public class YoutEntity {    @Id    private String id;    private String name;    @CompletionField(payloads = true, maxInputLength = 100)    private Completion suggest;    ...}

Check this link for example.