# Query documents present in both indexes

**URL:** <https://discuss.elastic.co/t/query-documents-present-in-both-indexes/127465>\
**Category:** Elasticsearch\
**Created:** [April 10, 2018, 10:47am UTC](https://discuss.elastic.co/t/query-documents-present-in-both-indexes/127465 "2018-04-10T10:47:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NerdSec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nerdsec/32/22056_2.png) [@NerdSec](https://discuss.elastic.co/u/NerdSec)\
**Post date:** [April 10, 2018, 10:47am UTC](https://discuss.elastic.co/t/query-documents-present-in-both-indexes/127465/1 "2018-04-10T10:47:26Z")

</div>

Hi,

I have two indices:

1. info-source
2. info-destination

Both the indices have a few similar field. One such field is the `ip` field.

I wish to write a query that will give me a list of `ip` present in both indices. Can this be accomplished in **elasticsearch**? Currently I am doing this in Python, but this adds an overhead which I wish to avoid. Please help.

Regards,  
N

---

<div class="post-metadata">

**Author:** ![NerdSec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nerdsec/32/22056_2.png) [@NerdSec](https://discuss.elastic.co/u/NerdSec)\
**Post date:** [April 11, 2018, 4:42am UTC](https://discuss.elastic.co/t/query-documents-present-in-both-indexes/127465/2 "2018-04-11T04:42:17Z")

</div>

Hi,

Can anyone please confirm if JOINS are possible?

Regards,  
N

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 11, 2018, 5:30am UTC](https://discuss.elastic.co/t/query-documents-present-in-both-indexes/127465/3 "2018-04-11T05:30:25Z")

</div>

It's not. Unless you use parent / child feature

BTW read [this](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and specifically the "Also be patient" part.

It's fine to answer on your own thread after 2 or 3 days (not including weekends) if you don't have an answer.

---

<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:** [May 9, 2018, 5:30am UTC](https://discuss.elastic.co/t/query-documents-present-in-both-indexes/127465/4 "2018-05-09T05:30:38Z")

</div>

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