# Globalsearch: Resolving Logic From Person Type to Country Type

**URL:** <https://discuss.elastic.co/t/globalsearch-resolving-logic-from-person-type-to-country-type/327736>\
**Category:** Elasticsearch\
**Created:** [March 15, 2023, 8:20am UTC](https://discuss.elastic.co/t/globalsearch-resolving-logic-from-person-type-to-country-type/327736 "2023-03-15T08:20:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Java2avaj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/java2avaj/32/99497_2.png) [@Java2avaj](https://discuss.elastic.co/u/Java2avaj)\
**Post date:** [March 15, 2023, 8:20am UTC](https://discuss.elastic.co/t/globalsearch-resolving-logic-from-person-type-to-country-type/327736/1 "2023-03-15T08:20:36Z")

</div>

We have a "globalsearch" index that stores "person", "address", "country" information in one single index:

```auto
{
"id":"PER_0001",
"type":"person",
"addressId":"ADDR_001"
},
{
"id":"ADDR_001",
"type":"address",
"countryId":"COUNT_001"
},
{
"id":"COUNT_001",
"type":"country",
"name":"India"
}

```

Given type=PERSON and id="PER\_001", how can I "map" or query so that I can retrieve the country COUNT\_001 details?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 19, 2023, 11:00pm UTC](https://discuss.elastic.co/t/globalsearch-resolving-logic-from-person-type-to-country-type/327736/2 "2023-03-19T23:00:46Z")

</div>

Take a look at [Join field type | Elasticsearch Guide [8.6] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.6/parent-join.html), but it's an indexing time thing.

---

<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:** [April 16, 2023, 11:01pm UTC](https://discuss.elastic.co/t/globalsearch-resolving-logic-from-person-type-to-country-type/327736/3 "2023-04-16T23:01:38Z")

</div>

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