# Compare two document type values under one index and print difference

**URL:** https://discuss.elastic.co/t/compare-two-document-type-values-under-one-index-and-print-difference/141118
**Category:** Elasticsearch
**Created:** [July 23, 2018, 9:09am UTC](https://discuss.elastic.co/t/compare-two-document-type-values-under-one-index-and-print-difference/141118 "2018-07-23T09:09:31Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Md\_Ghulam\_khaja](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Md\_Ghulam\_khaja](https://discuss.elastic.co/u/Md_Ghulam_khaja)
#### Post date: [July 23, 2018, 9:09am UTC](https://discuss.elastic.co/t/compare-two-document-type-values-under-one-index-and-print-difference/141118/1 "2018-07-23T09:09:31Z")

</div>

I have two mysql tables containing thousands of rows in each table. I have index all records into elasticsearch using logstash jdbc plugin.

The Idea is to compare difference between two tables using Elasticsearch in a very fast manner. Faster than SQL.

I have index called elasticdata and two documents type table1 and table2.

I have to compare each column1 of table1 document type with all rows of table2 ducument type. If diference is foud print the value.

How it can be achived in elastic search. Please suggest.

---

<div class="post-metadata">

### Author: ![Md\_Ghulam\_khaja](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Md\_Ghulam\_khaja](https://discuss.elastic.co/u/Md_Ghulam_khaja)
#### Post date: [July 23, 2018, 12:45pm UTC](https://discuss.elastic.co/t/compare-two-document-type-values-under-one-index-and-print-difference/141118/2 "2018-07-23T12:45:19Z")

</div>

Can somebody help me out?

---

<div class="post-metadata">

### Author: ![Md\_Ghulam\_khaja](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Md\_Ghulam\_khaja](https://discuss.elastic.co/u/Md_Ghulam_khaja)
#### Post date: [July 23, 2018, 12:46pm UTC](https://discuss.elastic.co/t/compare-two-document-type-values-under-one-index-and-print-difference/141118/3 "2018-07-23T12:46:07Z")

</div>

magnusbaek, Can you help me on this?

---

<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: [July 23, 2018, 1:09pm UTC](https://discuss.elastic.co/t/compare-two-document-type-values-under-one-index-and-print-difference/141118/4 "2018-07-23T13:09:27Z")

</div>

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: ![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: [July 23, 2018, 1:09pm UTC](https://discuss.elastic.co/t/compare-two-document-type-values-under-one-index-and-print-difference/141118/5 "2018-07-23T13:09:50Z")

</div>

Please never ping people who are not already participating in your thread.

---

<div class="post-metadata">

### Author: ![Md\_Ghulam\_khaja](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Md\_Ghulam\_khaja](https://discuss.elastic.co/u/Md_Ghulam_khaja)
#### Post date: [July 23, 2018, 1:24pm UTC](https://discuss.elastic.co/t/compare-two-document-type-values-under-one-index-and-print-difference/141118/6 "2018-07-23T13:24:19Z")

</div>

Got you.

---

<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: [August 20, 2018, 1:24pm UTC](https://discuss.elastic.co/t/compare-two-document-type-values-under-one-index-and-print-difference/141118/7 "2018-08-20T13:24:26Z")

</div>

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