Я сделал собственный анализатор, и он заработал:
@Document(indexName = "db", type = "user")
@Getter
@Setter
@Setting(settingPath = "/settings.json")
public class User{
@org.springframework.data.annotation.Id
private Long id;
@Field(analyzer= "autocomplete",type = FieldType.String )
private String name;
}
файл json:
{
"index": {
"number_of_shards": 1,
"analysis": {
"filter": {
"autocomplete_filter": {
"type": "edge_ngram",
"min_gram": 1,
"max_gram": 20
}
},
"analyzer": {
"autocomplete": {
"type": "custom",
"tokenizer": "keyword",
"filter": [
"lowercase",
"autocomplete_filter"
]
}
}
}
}
}