# Expanding Geo regions for matching

**URL:** <https://discuss.elastic.co/t/expanding-geo-regions-for-matching/129761>\
**Category:** Elasticsearch\
**Created:** [April 27, 2018, 4:25am UTC](https://discuss.elastic.co/t/expanding-geo-regions-for-matching/129761 "2018-04-27T04:25:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amar\_R\_G](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@Amar\_R\_G](https://discuss.elastic.co/u/Amar_R_G)\
**Post date:** [April 27, 2018, 4:25am UTC](https://discuss.elastic.co/t/expanding-geo-regions-for-matching/129761/1 "2018-04-27T04:25:20Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [May 4, 2018, 3:41pm UTC](https://discuss.elastic.co/t/expanding-geo-regions-for-matching/129761/2 "2018-05-04T15:41:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 1, 2018, 3:41pm UTC](https://discuss.elastic.co/t/expanding-geo-regions-for-matching/129761/3 "2018-06-01T15:41:25Z")

</div>

Closed on June 1, 2018, 3:41pm UTC

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