# ELK 6.7.0: Search query match on inexisting fields

**URL:** <https://discuss.elastic.co/t/elk-6-7-0-search-query-match-on-inexisting-fields/175231>\
**Category:** Elasticsearch\
**Created:** [April 3, 2019, 3:01pm UTC](https://discuss.elastic.co/t/elk-6-7-0-search-query-match-on-inexisting-fields/175231 "2019-04-03T15:01:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![obuez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/obuez/32/71813_2.png) [@obuez](https://discuss.elastic.co/u/obuez)\
**Post date:** [April 3, 2019, 3:01pm UTC](https://discuss.elastic.co/t/elk-6-7-0-search-query-match-on-inexisting-fields/175231/1 "2019-04-03T15:01:36Z")

</div>

Hi all,

I just upgrade elasticsearch and kibana from version 6.5.0 to version 6.7.0  
There is an impact on my application as a specific query in kibana is not interpreted the same way as before.

ex: `field1: "test" AND field2: "test"`  
Would return every documents containing field1 and field2 with the specified values "test". If a document only contains field1 or field2 (with value "test") with the other absent, it wouldn't be returned.

With kibana version 6.7.0, if a document only contains field1 or field2 (with the correct value "test") and the other absent, it would be returned.  
ex:

```
{
  "query": {
    "bool": {
      "filter": [
        {
          "query_string": {
            "query": "field1:test AND field2:test"
          }
        }
      ]
    }
  }
}

```

From version 6.7.0 will also return events like:

```
{
    "field1": "test"
},
{
    "field1": "test",
    "field2": "test"
},
{
    "field2": "test"
}

```

Whereas before (6.5.0) it would only have returned:

```
{
     "field1": "test",
     "field2": "test"
}

```

Which is definitely screwing-up our expectations and application.  
I'm just wondering if this is a bug (I need to downgrade, or wait for a fix) or a feature (I need to refactor my application). Or ... ?

Thanks for your feedback

---

<div class="post-metadata">

**Author:** ![Bill\_McConaghy](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Bill\_McConaghy](https://discuss.elastic.co/u/Bill_McConaghy)\
**Post date:** [April 3, 2019, 3:37pm UTC](https://discuss.elastic.co/t/elk-6-7-0-search-query-match-on-inexisting-fields/175231/2 "2019-04-03T15:37:28Z")

</div>

I'm moving this to the Elasticsearch forum as I can reproduce this behavior in Console in Dev Tools going directly against Elasticsearch.

---

<div class="post-metadata">

**Author:** ![daanraman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daanraman/32/43421_2.png) [@daanraman](https://discuss.elastic.co/u/daanraman)\
**Post date:** [April 3, 2019, 4:08pm UTC](https://discuss.elastic.co/t/elk-6-7-0-search-query-match-on-inexisting-fields/175231/3 "2019-04-03T16:08:58Z")

</div>

For anyone running into the same issue: we had to hot-patch all the queries in our product with an "_exists_:" clause to return to the old behavior.

For example, instead of `NonExistingField1:test AND NonExistingField2:test` now becomes: `_exists_:NonExistingField1 AND _exists_:NonExistingField2 AND NonExistingField1:test AND NonExistingField2:test` which returns 0 events as you would expect.

---

<div class="post-metadata">

**Author:** ![Bill\_McConaghy](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Bill\_McConaghy](https://discuss.elastic.co/u/Bill_McConaghy)\
**Post date:** [April 3, 2019, 4:32pm UTC](https://discuss.elastic.co/t/elk-6-7-0-search-query-match-on-inexisting-fields/175231/4 "2019-04-03T16:32:51Z")

</div>

Thanks for the workaround suggestion @daanraman !

---

<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:** [May 1, 2019, 4:45pm UTC](https://discuss.elastic.co/t/elk-6-7-0-search-query-match-on-inexisting-fields/175231/5 "2019-05-01T16:45:42Z")

</div>

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