# Query results on a field for multiple values

**URL:** https://discuss.elastic.co/t/query-results-on-a-field-for-multiple-values/47278
**Category:** Elasticsearch
**Created:** [April 13, 2016, 4:23pm UTC](https://discuss.elastic.co/t/query-results-on-a-field-for-multiple-values/47278 "2016-04-13T16:23:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![adityaishu24](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@adityaishu24](https://discuss.elastic.co/u/adityaishu24)
#### Post date: [April 13, 2016, 4:23pm UTC](https://discuss.elastic.co/t/query-results-on-a-field-for-multiple-values/47278/1 "2016-04-13T16:23:42Z")

</div>

{  
"bool":{  
"query":{  
"must":{  
'match': { 'tag': {  
"query": "foo baz, bar",  
"type":"boolean"

}  
}  
}  
}  
}  
}  
The problem I face is that foo baz are not treated as one and I get hits for foo as well as baz as well as bar and as well as foo baz but I want results only for 'foo baz' and bar  
please anybody help

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [April 14, 2016, 1:33pm UTC](https://discuss.elastic.co/t/query-results-on-a-field-for-multiple-values/47278/2 "2016-04-14T13:33:28Z")

</div>

Hey,

check out the `default_operator` setting or the `minimum_should_match` option. Also the comma is not a marker for a phrase search. You should check out the documentation for the [match](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html) and the [match\_phrase](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html#query-dsl-match-query-phrase) queries to understand how they work.

This is a tricky topic and highly advise to get the fundamentals right by reading [the definitve guide](https://www.elastic.co/guide/en/elasticsearch/guide/master/full-text-search.html) on that.

--Alex

---

<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:59pm UTC](https://discuss.elastic.co/t/query-results-on-a-field-for-multiple-values/47278/3 "2017-07-05T22:59:17Z")

</div>


