# Match and Match\_phrase on multiple fields for the same query string

**URL:** <https://discuss.elastic.co/t/match-and-match-phrase-on-multiple-fields-for-the-same-query-string/50546>\
**Category:** Elasticsearch\
**Created:** [May 20, 2016, 9:52am UTC](https://discuss.elastic.co/t/match-and-match-phrase-on-multiple-fields-for-the-same-query-string/50546 "2016-05-20T09:52:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ASN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asn/32/10535_2.png) [@ASN](https://discuss.elastic.co/u/ASN)\
**Post date:** [May 20, 2016, 9:52am UTC](https://discuss.elastic.co/t/match-and-match-phrase-on-multiple-fields-for-the-same-query-string/50546/1 "2016-05-20T09:52:15Z")

</div>

I have to search for a keyword on multiple fields for the same query string.  
"bool": {  
"should": [  
{  
"match": {  
"ABC": "Apple"  
}  
},  
{  
"match": {  
"XYZ": "Apple"  
}  
}  
]

When I wrote the query DSL , it has been translated as multimatch query(Not sure if the above code and DSL are same)  
.Bool(b =\> b  
.Should(sh =\> sh  
.MultiMatch(c =\> c  
.Fields(f =\> f.Field(p =\> p.ABC).Field("XYZ"))  
.Query(keyz)))))

Similarly i want to write a DSL query but i want to do match\_phrase operation. Can some one help me in solving this.

TIA

---

<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:** [July 5, 2017, 10:50pm UTC](https://discuss.elastic.co/t/match-and-match-phrase-on-multiple-fields-for-the-same-query-string/50546/2 "2017-07-05T22:50:09Z")

</div>


