# Comparison of two different fields in two indexes

**URL:** <https://discuss.elastic.co/t/comparison-of-two-different-fields-in-two-indexes/246605>\
**Category:** Elasticsearch\
**Created:** [August 27, 2020, 11:22am UTC](https://discuss.elastic.co/t/comparison-of-two-different-fields-in-two-indexes/246605 "2020-08-27T11:22:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohitarorait82](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rohitarorait82/32/82981_2.png) [@rohitarorait82](https://discuss.elastic.co/u/rohitarorait82)\
**Post date:** [August 27, 2020, 11:22am UTC](https://discuss.elastic.co/t/comparison-of-two-different-fields-in-two-indexes/246605/1 "2020-08-27T11:22:14Z")

</div>

Hi All,

We have a scenario where we need to check whether this account number exists in both the indexes , is there a way or query to check the same.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 8, 2020, 4:41am UTC](https://discuss.elastic.co/t/comparison-of-two-different-fields-in-two-indexes/246605/2 "2020-09-08T04:41:13Z")

</div>

This sounds like a type of join, which Elasticsearch does not support. Doing this through a query at scale in a distributed system would also be quite expensive. You may however be able to create an account centric index using [transforms](https://www.elastic.co/guide/en/elasticsearch/reference/7.9/transforms.html) and then query that.

---

<div class="post-metadata">

**Author:** ![rohitarorait82](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rohitarorait82/32/82981_2.png) [@rohitarorait82](https://discuss.elastic.co/u/rohitarorait82)\
**Post date:** [September 8, 2020, 4:43am UTC](https://discuss.elastic.co/t/comparison-of-two-different-fields-in-two-indexes/246605/3 "2020-09-08T04:43:50Z")

</div>

Hi @Christian_Dahlqvist : I have created alias and it is giving desired results

---

<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:** [October 6, 2020, 4:43am UTC](https://discuss.elastic.co/t/comparison-of-two-different-fields-in-two-indexes/246605/4 "2020-10-06T04:43:54Z")

</div>

Closed on October 6, 2020, 4:43am UTC

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