# Elastic multy match query with order of words given shoul follow in resulted records

**URL:** <https://discuss.elastic.co/t/elastic-multy-match-query-with-order-of-words-given-shoul-follow-in-resulted-records/337827>\
**Category:** Elasticsearch\
**Created:** [July 6, 2023, 5:41pm UTC](https://discuss.elastic.co/t/elastic-multy-match-query-with-order-of-words-given-shoul-follow-in-resulted-records/337827 "2023-07-06T17:41:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lakshmikiran](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lakshmikiran/32/123147_2.png) [@Lakshmikiran](https://discuss.elastic.co/u/Lakshmikiran)\
**Post date:** [July 6, 2023, 5:41pm UTC](https://discuss.elastic.co/t/elastic-multy-match-query-with-order-of-words-given-shoul-follow-in-resulted-records/337827/1 "2023-07-06T17:41:43Z")

</div>

Using multi match queries in each query different words line word1 word2 word3 respectively. After search results also I'm expecting the words in same order, but in between of the words it could be present or not also. But the order should not change.

Input words:  
Word1: Google  
Word2: drive  
Word3: photos

In restless it could be "abc Google xyz drive rst photos bbc"

Here pre and post as well as middle it could be n number of words but the given words must follow order..

Can anyone help me on this  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [July 6, 2023, 6:49pm UTC](https://discuss.elastic.co/t/elastic-multy-match-query-with-order-of-words-given-shoul-follow-in-resulted-records/337827/2 "2023-07-06T18:49:53Z")

</div>

Hi @Lakshmikiran

My suggestion is to read about [match phrase](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query-phrase.html) and [span queries](https://www.elastic.co/guide/en/elasticsearch/reference/current/span-queries.html).

---

<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:** [August 3, 2023, 6:50pm UTC](https://discuss.elastic.co/t/elastic-multy-match-query-with-order-of-words-given-shoul-follow-in-resulted-records/337827/3 "2023-08-03T18:50:31Z")

</div>

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