ElasticSearch Partial Matching with edge_ngram -
i want return documents containing partial words in query.
i mean query below should return document containing "şehir merkezindeki tüm kuruluşlar".
i used analyzer using edge_ngram filter indexing , standard analyzer searching returns no result. wrong here?
i analyzed query text standard , edge_ngram analyzer. working expected.
sample data:
{ "name": "feyyaz", "surname": "ertugrul" }
query:
"query": { "match": { "_all": { "query": "ert", "analyzer": "standard" } } }
settings&mappings:
"settings": { "analysis": { "filter": { "autocomplete": { "type": "edge_ngram", "min_gram": 2, "max_gram": 20 } }, "analyzer": { "analyzer1": { "type": "custom", "tokenizer": "standard", "filter": [ "lowercase", "autocomplete" ] } } } }, "mappings": { "user": { "properties": { "name": { "type": "string", "analyzer": "analyzer1" }, "surname": { "type": "text", "analyzer": "analyzer1" } } } }
Comments
Post a Comment