# How to get the intersection of the search results of a multi-search in App-search?

**URL:** <https://discuss.elastic.co/t/how-to-get-the-intersection-of-the-search-results-of-a-multi-search-in-app-search/204154>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [October 18, 2019, 1:56am UTC](https://discuss.elastic.co/t/how-to-get-the-intersection-of-the-search-results-of-a-multi-search-in-app-search/204154 "2019-10-18T01:56:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![teja\_sri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/teja_sri/32/55614_2.png) [@teja\_sri](https://discuss.elastic.co/u/teja_sri)\
**Post date:** [October 18, 2019, 1:56am UTC](https://discuss.elastic.co/t/how-to-get-the-intersection-of-the-search-results-of-a-multi-search-in-app-search/204154/1 "2019-10-18T01:56:27Z")

</div>

Query:  
"queries": [  
{  
"search\_fields": {  
"fruit\_name": {}  
},  
"query": "apples"  
},  
{  
"search\_fields": {  
"type": {}  
},  
"query": "gala"  
}  
]

Result:

[  
{  
"results": [  
{  
"fruit\_id": {  
"raw": "9"  
},  
"fruit\_name": {  
"raw": "apple"  
},  
"type": {  
"raw": "gala"  
}  
"id": {  
"raw": "9"  
}  
},  
{  
"fruit\_id": {  
"raw": "1"  
},  
"fruit\_name": {  
"raw": "apple"  
},  
"type": {  
"raw": "red"  
}  
"id": {  
"raw": "1"  
}  
}  
]  
},

{  
"results": [  
{  
"fruit\_id": {  
"raw": "9"  
},  
"fruit\_name": {  
"raw": "apple"  
},  
"type": {  
"raw": "gala"  
}  
"id": {  
"raw": "9"  
}  
},  
{  
"fruit\_id": {  
"raw": "10"  
},  
"festival\_name": {  
"raw": "festival"  
},  
"type": {  
"raw": "gala"  
}  
"id": {  
"raw": "10"  
}  
}  
]  
}  
]

Is there any way to get the common result from both the result sets??

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [October 22, 2019, 11:44am UTC](https://discuss.elastic.co/t/how-to-get-the-intersection-of-the-search-results-of-a-multi-search-in-app-search/204154/2 "2019-10-22T11:44:13Z")

</div>

Hey @teja_sri.

To my knowledge, these queries are entirely separate. There is no way to get the intersection automatically, this is something you'd need to do programmatically on the response.

What is your use case for having multiple queries like this? I'm wondering if there's a way to achieve what you are trying to do with a single query and some filtering.

---

<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:** [November 19, 2019, 11:57am UTC](https://discuss.elastic.co/t/how-to-get-the-intersection-of-the-search-results-of-a-multi-search-in-app-search/204154/3 "2019-11-19T11:57:02Z")

</div>

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