I have an analyzer defined in my elasticsearch.yml conf file.
{code} index.analysis : analyzer : hsanalyzer : type: custom tokenizer : standard filter : [lowercase, autocomplete_filter] filter : autocomplete_filter : type: edge_ngram min_gram: 1 max_gram: 20 {code}
This analyzer allows an autocomplete search.
My domain object attribute is defined as
{code:java} @NotNull @Column(name = "title", nullable = false) @Field(index = Index.YES, store = Store.YES, analyze = Analyze.YES, analyzer = @Analyzer(definition = "hsanalyzer")) private String title; {code}
When the ES mapping is created, the analyzer is not specified for the title field. So my ES mapping is the following: {code} "title": { "type": "string" } {code}
instead of
{code} "title": { "analyzer": "hsanalyzer", "type": "string" } {code}
and consequently without the analyzer defined in the mapping the autocomplete does not work. |
|