Search across related resources


(ajan) #1

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


(system) #2