Parents with distinct children

An example of the data.
{
"_index": "act",
"_type": "_doc",
"_id": "2389939",
"_score": 1,
"_source": {
"photo_id": "2389939",
"family": [
{
"member_id": "3079805",
"member_detail_type_id": "343 350 351 368 370 373 377 384 642 717 723 815"
},
{
"member_id": "3079807",
"member_detail_type_id": "343 347 354 369 377 637 717 723 797 935"
}
]
}
},
{
"_index": "act",
"_type": "_doc",
"_id": "1302788",
"_score": 1,
"_source": {
"photo_id": "1302788",
"family": [
{
"member_id": "586908",
"member_detail_type_id": "343 347 352 362 384 634 717"
},
{
"member_id": "586909",
"member_detail_type_id": "243 247 252 283 662 798 936"
}
]
}
},
{
"_index": "act",
"_type": "_doc",
"_id": "1327646",
"_score": 1,
"_source": {
"photo_id": "1327646",
"family": [
{
"member_id": "638315",
"member_detail_type_id": "343 347 361 362 373 384 667 669 717 815"
}
]
}
},
{
"_index": "act",
"_type": "_doc",
"_id": "1420554",
"_score": 1,
"_source": {
"photo_id": "1420554",
"family": [
{
"member_id": "921081",
"member_detail_type_id": "344 350 353 355 362 373 426 433 441 815"
},
{
"member_id": "921082",
"member_detail_type_id": "243 244 250 263 333 650 758"
},
{
"member_id": "921083",
"member_detail_type_id": "343 347 354 373 426 441 635 642 717 815"
},
{
"member_id": "921084",
"member_detail_type_id": "243 250 254 263 266 274 758 798"
}
]
}
}

A collection of family photos. Each photo has at least one person in the photo. Each person in the photo has characteristics represented by member_detail_type_id. These are not unique, every member in the photo can have them. Currently the family data is nested. If i want to find a photo of a tall person or a tall person that is wearing a hat, I can pull that without any problems. However, if I want person A (tall, with hat -- 717, 347) but I also want person b (tall, with sunglasses -- 717 815) i have no idea how to bring back just those results.

I understand how to do them separately, however, how would I join(?) intersect(?) my results so that I only have the IDs of the photos that are in both sets? Also, how can i be certain that when searching for two people, I actually have two people, not one person that matches both criteria?

Is this possible? Is it possible with different data/ multiple indices?

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