Query results on a field for multiple values

{
"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

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 and the match_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 on that.

--Alex