# Unable to generate word sequence

**URL:** <https://discuss.elastic.co/t/unable-to-generate-word-sequence/104255>\
**Category:** Kibana\
**Created:** [October 17, 2017, 1:57pm UTC](https://discuss.elastic.co/t/unable-to-generate-word-sequence/104255 "2017-10-17T13:57:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kanchan](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@kanchan](https://discuss.elastic.co/u/kanchan)\
**Post date:** [October 17, 2017, 1:57pm UTC](https://discuss.elastic.co/t/unable-to-generate-word-sequence/104255/1 "2017-10-17T13:57:21Z")

</div>

Hi Team,  
I have create a query for searching data.

GET /coalition\_assets\_casematch/\_search  
{  
"query": {  
"multi\_match" : {  
"query": "media trader",  
"type": "best\_fields",  
"fields": ["coalition\_name"],  
"operator": "and"  
}  
},  
"size" : 10  
}

but in records I am not getting words in order like I am searching records which have **media trader** but if I have **coalition\_name: 'media trader'** that records also coming.  
how can I maintain words order while searching.

---

<div class="post-metadata">

**Author:** ![ppisljar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppisljar/32/11588_2.png) [@ppisljar](https://discuss.elastic.co/u/ppisljar)\
**Post date:** [October 17, 2017, 2:30pm UTC](https://discuss.elastic.co/t/unable-to-generate-word-sequence/104255/2 "2017-10-17T14:30:36Z")

</div>

the order of query terms does not have an effect to the order of results

if you are trying to match exact query try to use: match query phrase: [https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query-phrase.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query-phrase.html)

---

<div class="post-metadata">

**Author:** ![kanchan](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@kanchan](https://discuss.elastic.co/u/kanchan)\
**Post date:** [October 18, 2017, 4:10am UTC](https://discuss.elastic.co/t/unable-to-generate-word-sequence/104255/3 "2017-10-18T04:10:49Z")

</div>

but match phrase will take care of all words.I want if any one word also present that records also show and if 2 words match that also should show but that two words should follow the sequence.using match\_phrase it will give only if match all words.

---

<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:** [November 15, 2017, 4:10am UTC](https://discuss.elastic.co/t/unable-to-generate-word-sequence/104255/4 "2017-11-15T04:10:54Z")

</div>

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