# Issue with multi\_match queries for nested documents

**URL:** <https://discuss.elastic.co/t/issue-with-multi-match-queries-for-nested-documents/23393>\
**Category:** Elasticsearch\
**Created:** [April 24, 2015, 2:09pm UTC](https://discuss.elastic.co/t/issue-with-multi-match-queries-for-nested-documents/23393 "2015-04-24T14:09:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anatoly\_Petkevich](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anatoly_petkevich/32/97607_2.png) [@Anatoly\_Petkevich](https://discuss.elastic.co/u/Anatoly_Petkevich)\
**Post date:** [April 24, 2015, 2:09pm UTC](https://discuss.elastic.co/t/issue-with-multi-match-queries-for-nested-documents/23393/1 "2015-04-24T14:09:14Z")

</div>

I need multilanguage text search for documents and decided to use types and  
multi\_match queries for that as described in [http://www.elastic.co/guide/en/elasticsearch/guide/current/mapping.html](http://www.elastic.co/guide/en/elasticsearch/guide/current/mapping.html)

It works smoothly for flat documents, but I cannot figure out whether it is  
applicable to nested documents too.  
Here is a test index "persons"

{  
"settings" : {  
"number\_of\_shards" : 2  
},  
"mappings" : {  
"person\_eng":{  
"properties": {  
"name" : {  
"type" : "string", "analyzer" : "english"  
},  
"car":{  
"properties": {  
"make": {  
"type": "string", "analyzer" : "english"  
},  
"model": {  
"type": "string", "analyzer" : "english"  
}  
},  
"type" : "nested"  
}  
}  
},  
"person\_de":{  
"properties": {  
"name" : {  
"type" : "string", "analyzer" : "german"  
},  
"car":{  
"properties": {  
"make": {  
"type": "string", "analyzer" : "german"  
},  
"model": {  
"type": "string", "analyzer" : "german"  
}  
},  
"type" : "nested"  
}  
}  
}

```
}

```

}

After putting documents

curl -XPUT '[http://localhost:9200/persons/person\_eng/1](http://localhost:9200/persons/person_eng/1)' -d '{  
"name" : "Bob Mahoney",  
"car" :  
{  
"make" : "Vickers Armstrongs",  
"model" : "Matilda"  
}  
}'

curl -XPUT '[http://localhost:9200/persons/person\_de/1](http://localhost:9200/persons/person_de/1)' -d '{  
"name" : "Heinz Guderian",  
"car" :  
{  
"make" : "Porsche",  
"model" : "Tiger"  
}  
}'

the following query works as expected

{  
"query": {  
"multi\_match": {  
"query": "Heinz",  
"fields": [  
"person\_de.name",  
"person\_eng.name"  
]  
}  
}  
}

but a nested query doesn't return any result

{  
"query": {  
"nested": {  
"path": "car",  
"query": {  
"multi\_match": {  
"query": "Heinz",  
"fields": [  
"person\_de.car.make",  
"person\_eng.car.make"  
]  
}  
}  
}  
}  
}

What is wrong here?

If fully qualified field name (including type name) is not supported in  
multi\_match query for nested documents, I quess it can be replaced by  
corresponding  
dis\_max or boolean query.

Thanks in advance!

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/58601881-763c-4194-9f04-0a0735a3f822%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/58601881-763c-4194-9f04-0a0735a3f822%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:17am UTC](https://discuss.elastic.co/t/issue-with-multi-match-queries-for-nested-documents/23393/2 "2017-07-06T00:17:47Z")

</div>


