# Query notation question

**URL:** <https://discuss.elastic.co/t/query-notation-question/158688>\
**Category:** Elasticsearch\
**Created:** [November 29, 2018, 6:22am UTC](https://discuss.elastic.co/t/query-notation-question/158688 "2018-11-29T06:22:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)\
**Post date:** [November 29, 2018, 6:22am UTC](https://discuss.elastic.co/t/query-notation-question/158688/1 "2018-11-29T06:22:10Z")

</div>

Hi All,

I am perfoming this query

```
{
  "query": {
    "bool": {
      "must": [
        {
          "query_string": {
            "analyze_wildcard": "false",
            "query": "source_affiliate:nlmail AND (_exists_:tmngx_state OR _exists_:lock_reason OR _exists_:spamAction OR _exists_:mailUserStatus OR _exists_:mailQuota OR _exists_:mailbox_usage)"
          }
        },
        {
          "range": {
            "@timestamp": {
              "gte": "now-5m",
              "lte": "now"
            }
          }
        }
      ],
      "must_not": []
    }
  }
}

```

But I am wondering if I write this the below part correctly.

`source_affiliate:nlmail AND (_exists_:tmngx_state OR _exists_:lock_reason OR _exists_:spamAction OR _exists_:mailUserStatus OR _exists_:mailQuota OR _exists_:mailbox_usage)`

I am trying the below notation aswell and that seems to give me the same result.

`source_affiliate:nlmail AND _exists_:(tmngx_state OR lock_reason OR spamAction OR mailUserStatus OR mailQuota OR mailbox_usage)`

I wonder which one is correct or are the both correct?

Regards,  
Paul.

---

<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:** [December 27, 2018, 6:22am UTC](https://discuss.elastic.co/t/query-notation-question/158688/2 "2018-12-27T06:22:12Z")

</div>

Closed on December 27, 2018, 6:22am UTC

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