# Qerying only those documents, which has their value of some field never contained by another documents' field

**URL:** <https://discuss.elastic.co/t/qerying-only-those-documents-which-has-their-value-of-some-field-never-contained-by-another-documents-field/74813>\
**Category:** Elasticsearch\
**Created:** [February 12, 2017, 3:22pm UTC](https://discuss.elastic.co/t/qerying-only-those-documents-which-has-their-value-of-some-field-never-contained-by-another-documents-field/74813 "2017-02-12T15:22:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![daaakeee](https://avatars.discourse-cdn.com/v4/letter/d/dbc845/32.png) [@daaakeee](https://discuss.elastic.co/u/daaakeee)\
**Post date:** [February 12, 2017, 3:22pm UTC](https://discuss.elastic.co/t/qerying-only-those-documents-which-has-their-value-of-some-field-never-contained-by-another-documents-field/74813/1 "2017-02-12T15:22:33Z")

</div>

Hi dear friends. Is it possible to get documents in such way, where in result we dont have documents which has their value contained by another documents' field..  
Let's consider we have following documents:

```auto
              "field1": "a"
       },
       "doc2":{
              "field1": "ab"
       },
       "doc3":{
              "field1": "abc"
       },
       "doc4":{
              "field1": "qwerty"
       }
``
So the result will be **doc3** and **doc4** , because **doc3** contains **doc2** and **doc1**
Thanks in advance!
```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 13, 2017, 8:31am UTC](https://discuss.elastic.co/t/qerying-only-those-documents-which-has-their-value-of-some-field-never-contained-by-another-documents-field/74813/2 "2017-02-13T08:31:25Z")

</div>

As I mentioned in your other thread, you cannot do this.

---

<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:** [March 13, 2017, 8:31am UTC](https://discuss.elastic.co/t/qerying-only-those-documents-which-has-their-value-of-some-field-never-contained-by-another-documents-field/74813/3 "2017-03-13T08:31:26Z")

</div>

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