# How to diff multiple arrays in ES?

**URL:** https://discuss.elastic.co/t/how-to-diff-multiple-arrays-in-es/143856
**Category:** Elasticsearch
**Created:** [August 10, 2018, 10:14am UTC](https://discuss.elastic.co/t/how-to-diff-multiple-arrays-in-es/143856 "2018-08-10T10:14:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![chuckoh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chuckoh/32/26752_2.png) [@chuckoh](https://discuss.elastic.co/u/chuckoh)
#### Post date: [August 10, 2018, 10:14am UTC](https://discuss.elastic.co/t/how-to-diff-multiple-arrays-in-es/143856/1 "2018-08-10T10:14:57Z")

</div>

I am using Elasticsearch 6.0.1 and I have the following 3 indexes.

```auto
index1
{
  'id': 1,
  'list': [1, 2, 3, 4, 5, 6, 7, 8, 9]
}

index2
{
  'id': 1,
  'list': [1, 2, 3, 100, 101, 102, ...]
}

index3
{
  'id': 1,
  'list': [4, 5, 6, 200, 201, 202, ...]
}

```

objective:

I want to get an array of containing all the entries from index1's list that are not present in any of the union of index2's list and index3's list.

ex) with the above example, the result I'd like to have is [7, 8, 9]

how do I go about doing this in Elasticsearch?

---

<div class="post-metadata">

### Author: ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)
#### Post date: [August 12, 2018, 5:03pm UTC](https://discuss.elastic.co/t/how-to-diff-multiple-arrays-in-es/143856/2 "2018-08-12T17:03:30Z")

</div>

Elasticsearch is a search and aggregation engine only. It does not have any capabilities for processing datasets like that.

You could try using [es-hadoop](https://www.elastic.co/guide/en/elasticsearch/hadoop/current/index.html) and do such processing with Apache Spark, for instance (if your dataset is really large)

---

<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: [September 9, 2018, 5:03pm UTC](https://discuss.elastic.co/t/how-to-diff-multiple-arrays-in-es/143856/3 "2018-09-09T17:03:32Z")

</div>

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