# Should in filtered query

**URL:** <https://discuss.elastic.co/t/should-in-filtered-query/70918>\
**Category:** Elasticsearch\
**Created:** [January 9, 2017, 6:31am UTC](https://discuss.elastic.co/t/should-in-filtered-query/70918 "2017-01-09T06:31:52Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 9, 2017, 9:32am UTC](https://discuss.elastic.co/t/should-in-filtered-query/70918/6 "2017-01-09T09:32:21Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will make your post more readable.

I'm editing your post.

I think it's correct because `should` is not mandatory here as you have another condition which is the `filter` part.

So if `should` clause match, you will have a better score than without.

I'd put both in filter in that case. Like:

```auto
GET smsc_logs-2017.01.09/_search
{
  "query": {
    "bool": {
      "filter": [
        {
          "wildcard": {
            "path": "/home/GEMS/ES/CDR/Delivery/SMSCDR_DEL_ATTEMPT_16051810*.log"
          }
        },{
          "term": {
            "RecordType": "DelAck"
          }
        }
      ]
    }
  }
}

```

---

_[View the full topic](https://discuss.elastic.co/t/should-in-filtered-query/70918)._
