Synonym_filter and edge_ngram token filter not working together

My index setting -

{
"settings": {
"number_of_shards": 1,
"analysis": {
"filter": {
"autocomplete_filter": {
"type": "edge_ngram",
"min_gram": 1,
"max_gram": 50
},
"synonym" : {
"type" : "synonym",
"synonyms_path" : "synonym.txt"
}
},
"analyzer": {
"autocomplete": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"synonym",
"autocomplete_filter"
]
},
"search_synonyms" : {
"tokenizer" : "standard",
"filter" : ["synonym"]
}
}
}
}
}

Indexing work well but at the time of search If I use autocomplete analyzer it produces synonym results but along with random match

Can you explain a bit more and show an example that illustrates your issue? You should also provide your mapping and what you're trying to search? There's probably a logical explanation behind this.

As explained in -https://www.elastic.co/guide/en/elasticsearch/guide/master/_index_time_search_as_you_type.html

I have created an index with edge-ngram and synonym filter.
To support synonym at search time I have defined search_synonyms analyzer.
query time synonym also work with autocomplete analyzer but it produces a lot verbose result before an exact match
and defined query time analyser won't work while search_as_you_type it only work with exact match.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.