# How to achieve multiple match\_phrase\_prefix queries using query\_string

**URL:** https://discuss.elastic.co/t/how-to-achieve-multiple-match-phrase-prefix-queries-using-query-string/208743
**Category:** Elasticsearch
**Created:** [November 20, 2019, 4:48pm UTC](https://discuss.elastic.co/t/how-to-achieve-multiple-match-phrase-prefix-queries-using-query-string/208743 "2019-11-20T16:48:59Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ankur\_singla](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankur_singla/32/45612_2.png) [@ankur\_singla](https://discuss.elastic.co/u/ankur_singla)
#### Post date: [November 20, 2019, 4:48pm UTC](https://discuss.elastic.co/t/how-to-achieve-multiple-match-phrase-prefix-queries-using-query-string/208743/1 "2019-11-20T16:48:59Z")

</div>

Hi

I have multiple **match\_phrase\_prefix** queries which I am trying to combine in one query.

```
GET test/_search
{
  "query": {
    "bool": {
      "should": [
        {
          "match_phrase_prefix": {
            "test_data": {
              "query": "search of"
            }
          }
        },
        {
          "match_phrase_prefix": {
            "test_data": {
              "query": "world in"
            }
          }
        }
      ]
    }
  }
}

```

I am combining similar multiple **match\_phrase** queries using **simple\_query\_string** like this-

```
GET test/_search
{
  "query": {
    "simple_query_string": {
      "query": "\"search of\" \"world in\"",
        "fields": ["test_data"]
    }
  }
}

```

Is there a way to combine multiple **match\_phrase\_prefix** queries also using **simple\_query\_string** or another query?

---

<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: [December 18, 2019, 4:54pm UTC](https://discuss.elastic.co/t/how-to-achieve-multiple-match-phrase-prefix-queries-using-query-string/208743/2 "2019-12-18T16:54:46Z")

</div>

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