# Search across related resources

**URL:** <https://discuss.elastic.co/t/search-across-related-resources/7821>\
**Category:** Elasticsearch\
**Created:** [May 23, 2012, 10:37am UTC](https://discuss.elastic.co/t/search-across-related-resources/7821 "2012-05-23T10:37:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajan](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@ajan](https://discuss.elastic.co/u/ajan)\
**Post date:** [May 23, 2012, 10:37am UTC](https://discuss.elastic.co/t/search-across-related-resources/7821/1 "2012-05-23T10:37:34Z")

</div>

I have a requirement to retrieve results sorted on attributes of  
related resources. Here are some details;

I have a index 'car' defined to index various types of cars and the I  
have another index 'group' defined to state that a set of cars belong  
to a particular group. The json documents indexed are;

{  
"DisplayName":"Car-c35cceb24ca54015a04cdc2802cb51a5",  
"Type":"Sedan",  
"LastUpdated":1335366184748,  
"LastUpdatedDateTime":"2012-04-25T11:03:04.748-0400",  
"Model":"Nissan Sunny XL",  
"Name":"Car-c35cceb24ca54015a04cdc2802cb51a5",  
"Identifier":"tag:dealer@Car-c35cceb24ca54015a04cdc2802cb51a5"  
}

{  
"DisplayName":"Group-e2a9d3fe-5159-46c5-a8be-44c026e17d10",  
"Identifier":"tag:dealer@Group-e2a9d3fe-5159-46c5-a8be-44c026e17d10",  
"LastUpdatedTime":" 2012-05-03T07:28:50.683-0400",  
"Name":"Group-e2a9d3fe-5159-46c5-a8be-44c026e17d10",  
"Identifier":"tag:dealer@Group-e2a9d3fe-5159-46c5-a8be-44c026e17d10",  
"contains":"tag:dealer@Car-c35cceb24ca54015a04cdc2802cb51a5",  
"contains":"tag:dealer@Car-54e14eae9f5b44d09cd476d4b81e4268",  
"contains":"tag:dealer@Car-55b4ddb5c9344b39baab37dfcd052daa",  
"contains":"tag:dealer@Car-e7a849f7a8474aedb2da22471405ab3d",  
"contains":"tag:dealer@Car-81f4da62a65e4d9eae67403312e99956"  
}

What I want here is that the to be able to retrieve the cars that are  
members of the Group and sort by a field of car.

I'm looking at the nested query for this. I'm I looking at the correct  
place for this?

With best regards,  
Afzal

---

<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:** [July 6, 2017, 3:27am UTC](https://discuss.elastic.co/t/search-across-related-resources/7821/2 "2017-07-06T03:27:33Z")

</div>

Closed on July 6, 2017, 3:27am UTC


