# Does word order matter in my query?

**URL:** <https://discuss.elastic.co/t/does-word-order-matter-in-my-query/143947>\
**Category:** Elasticsearch\
**Created:** [August 10, 2018, 11:05pm UTC](https://discuss.elastic.co/t/does-word-order-matter-in-my-query/143947 "2018-08-10T23:05:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pemfir](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@pemfir](https://discuss.elastic.co/u/pemfir)\
**Post date:** [August 10, 2018, 11:05pm UTC](https://discuss.elastic.co/t/does-word-order-matter-in-my-query/143947/1 "2018-08-10T23:05:54Z")

</div>

I am trying to put together a query. field1 is a big text field. I am looking for key words in there. order of keywords do not matter. I would like to know if the query below achieves that. Thank you !

```
query_template = {
      "query" : {
       "bool": {
       "should" : 
                [
        {"match": {"field1": {"query": "i do not care about the order of keywords here", "boost": 10}}},
                ]
              }         
      }
    }
```

---

<div class="post-metadata">

**Author:** ![abdon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdon/32/9195_2.png) [@abdon](https://discuss.elastic.co/u/abdon)\
**Post date:** [August 12, 2018, 9:40am UTC](https://discuss.elastic.co/t/does-word-order-matter-in-my-query/143947/2 "2018-08-12T09:40:15Z")

</div>

If you go with the defaults, and `field1` is a `text` field with the `standard` analyzer, then order does indeed not matter. However, if you have applied a custom mapping (for example, if the field is mapped as type `keyword` or if it has an analyzer with `shingles`) then order may matter.

---

<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:** [September 9, 2018, 9:40am UTC](https://discuss.elastic.co/t/does-word-order-matter-in-my-query/143947/3 "2018-09-09T09:40:20Z")

</div>

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