# Multiple regexp query?

**URL:** <https://discuss.elastic.co/t/multiple-regexp-query/80117>\
**Category:** Elasticsearch\
**Created:** [March 27, 2017, 10:06am UTC](https://discuss.elastic.co/t/multiple-regexp-query/80117 "2017-03-27T10:06:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anubha\_Agrawal](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@Anubha\_Agrawal](https://discuss.elastic.co/u/Anubha_Agrawal)\
**Post date:** [March 27, 2017, 10:06am UTC](https://discuss.elastic.co/t/multiple-regexp-query/80117/1 "2017-03-27T10:06:26Z")

</div>

I want to query two fields at the same time using regexp. For example- With the sample Shakespeare dataset present in Elasticsearch, I want to query fields play\_name and speaker.  
I want to get entries where play\_name is Henry IV and speaker is KING HENRY IV. I was able to do that with query-

```auto
GET /shakespeare/line/_search?size=1000
{
  "query": {
    "bool": {
      "must":[
        {
          "match_phrase": {
            "play_name": "Henry IV"}
        },
        { "match_phrase": {
            "speaker": "KING HENRY IV"}
        }
        ]
    }
  }
}

```

Now I want to enhance this in a way that even if I write Henry instead of Henry IV or KING HENRY IV , I get the same documents.

---

<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:** [March 31, 2017, 7:04am UTC](https://discuss.elastic.co/t/multiple-regexp-query/80117/2 "2017-03-31T07:04:05Z")

</div>

a match query would do that OOTB no? Why a match\_phrase in that case?

---

<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:** [April 28, 2017, 7:04am UTC](https://discuss.elastic.co/t/multiple-regexp-query/80117/3 "2017-04-28T07:04:09Z")

</div>

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