# Compare a field between two Index

**URL:** <https://discuss.elastic.co/t/compare-a-field-between-two-index/358401>\
**Category:** Elasticsearch\
**Created:** [April 29, 2024, 7:57am UTC](https://discuss.elastic.co/t/compare-a-field-between-two-index/358401 "2024-04-29T07:57:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajaya\_panda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ajaya_panda/32/133946_2.png) [@ajaya\_panda](https://discuss.elastic.co/u/ajaya_panda)\
**Post date:** [April 29, 2024, 7:57am UTC](https://discuss.elastic.co/t/compare-a-field-between-two-index/358401/1 "2024-04-29T07:57:04Z")

</div>

Hi Team,  
I want to compare a field between two index are have same value or not. How can we perform that? please provide the suggestions.

Example:  
Let's say I have **two indexes** one is **onlineSale** and another is **offlineSale**. And both the index have a **field** called **maxQuantityCanSell**. And I want list of items whose **maxQuantityCanSell** value not same in both the index.

Please suggest are we able to achieve this or not in Elasticsearch.

---

<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:** [April 29, 2024, 8:07am UTC](https://discuss.elastic.co/t/compare-a-field-between-two-index/358401/2 "2024-04-29T08:07:40Z")

</div>

That sounds a lot like a join, which Elasticsearch does not support. I therefore do not think you can do this in a single query, so you may need to write a script outside Elasticsearch.
