Expanding Geo regions for matching

I have a specific question related to geographical regions. I have a requirement where if I execute a search query with the string "Hotels in Asia". It should return documents that match this query but also should be able to return documents that match constituent countries like "Hotels in India", "Hotels in China", "Hotels in Japan". Similarly, 'Hotels in Asia Pacific", should return documents that match the constituent countries. I tried using synonyms in this form:
Asia=>South Asia,South East Asia,Far East....
South Asia=>India,Bangladesh,Sri Lanka
But looks like the synonyms are not transitive in the sense if A => B and B => C, then A gets replaced by B but not by Synonyms of B. Any solution for this?

The recursive application of synonyms is not supported. I can think of two ways to deal with this. You can write a script to convert your synonyms list into a fully expanded synonyms list before supplying it to elasticsearch. The second way, instead of indexing just Japan with each document you can index Asia, Asia Pacific and Japan you can do it either in your app or by applying index time synonyms.

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