# Can't find in query but can find in filter

**URL:** <https://discuss.elastic.co/t/cant-find-in-query-but-can-find-in-filter/212882>\
**Category:** Elasticsearch\
**Created:** [December 23, 2019, 6:34pm UTC](https://discuss.elastic.co/t/cant-find-in-query-but-can-find-in-filter/212882 "2019-12-23T18:34:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dmitry1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dmitry1/32/50610_2.png) [@Dmitry1](https://discuss.elastic.co/u/Dmitry1)\
**Post date:** [December 23, 2019, 6:34pm UTC](https://discuss.elastic.co/t/cant-find-in-query-but-can-find-in-filter/212882/1 "2019-12-23T18:34:48Z")

</div>

Hello, I have 7.5.0 ELK stack. And see very strange situation. I have index with "message" field and for example this line in it:

```
[comgId:1773182151883136235;expired:false;delivered:true;secured:false;querySecured:true]

```

when I do query "message : 1773182151883136235" it finds nothing (from Discovery page in Kibana)

but if I add filter :

```
{
  "query": {
    "match": {
      "message": {
        "query": "1773182151883136235",
        "type": "phrase"
      }
    }
  }
}

```

elastic find that string. Why???

When inspect both queries I see that search parameters passed in "query" -\> "bool" -\> "filter": array.  
But when I do query - it has :

```
  "bool": {
    "should": [
      {
        "match": {
          "message": 1773182151883136300
        }
      }
    ],
    "minimum_should_match": 1
  }

```

and find nothing, but with filter request has:

```
{
  "match_phrase": {
    "message": {
      "query": "1773182151883136235"
    }
  }
},

```

and search succeeded

For users more convenient write search queries in familiar search bar, instead create filter. Why this happened - is this bug or normal behavior ?  
Thank you in advance.

---

<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:** [January 20, 2020, 6:34pm UTC](https://discuss.elastic.co/t/cant-find-in-query-but-can-find-in-filter/212882/2 "2020-01-20T18:34:57Z")

</div>

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