How is it failing? It's just not returning the expected results?
The way you've used the bool filter with the bool must multi_match appears correct.
Can you test only your filter to ensure that's working as expected.
Then test only your multi_match query to ensure that's working as expected.
So testing just the filter:
{
"query": {
"bool": {
"filter": {
"term": {
"locale": "en_US"
}
}
}
}
}
Testing just the multi_match:
{
"query": {
"bool": {
"must": {
"multi_match": {
"query": "iPhone",
"type": "most_fields",
"fields": [
"comment",
"content.main.title"
]
}
}
}
}
}
And do you see expected results from those separate queries?
So using the example docs I had above, the same type of queries with those doc would be:
# test multi_match for "testing3" in a set of fields
GET /index1,index2/_search
{
"query": {
"bool": {
"must": {
"multi_match": {
"query": "testing3",
"fields": [
"A",
"B",
"C",
"D",
"E",
"F",
"G"
]
}
}
}
}
}
# Now test the filter by itself, only docs with "only" in a "G" field
GET /index1,index2/_search
{
"query": {
"bool": {
"filter": {
"term": {
"G": "only"
}
}
}
}
}
# now combine the known working multi_match query with the working filter
GET /index1,index2/_search
{
"query": {
"bool": {
"must": {
"multi_match": {
"query": "testing3",
"fields": [
"A",
"B",
"C",
"D",
"E",
"F",
"G"
]
}
},
"filter": {
"term": {
"G": "only"
}
}
}
}
}