Synonym search in dictionary elasticsearch not result

(Hoàng Minh Tân) #1

Hi all,
I want use synonym filter for search, my config

analysis: { filter: { synonym_filter: { type: "synonym", synonyms: [ "tp, saigon, sai gon, hcm, tphcm, sài gòn, sàigòn => Thành phố Hồ Chí Minh", "tp, hn, ha noi, noi ha => Hà Nội" ] } }, analyzer: { synonym_analyzer: { filter: [ "standard", "synonym_filter", "lowercase", "asciifolding" ], type: "custom", tokenizer: "whitespace" } } }

But when i search:
{ "query": { "multi_match": { "query": "tp", "type": "best_fields", "fields": [ "name" ], "operator": "and" } } }

Elastic only result one doc "Thành phố Hồ Chí Minh". Could u tell me why and how to fix it.
Thanks all.

(Jun Ohtani) #2


Can you get the mapping of your index?
And can you explain your data in your index?
There is no information how many data you have, what you expect your query, etc...

(Hoàng Minh Tân) #3

Thanks for your reply, i had fixed it :slight_smile:

(system) #4

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