# Using a nested object field in a multi\_match query

**URL:** <https://discuss.elastic.co/t/using-a-nested-object-field-in-a-multi-match-query/19201>\
**Category:** Elasticsearch\
**Created:** [August 11, 2014, 5:29pm UTC](https://discuss.elastic.co/t/using-a-nested-object-field-in-a-multi-match-query/19201 "2014-08-11T17:29:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Topper1](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@Mike\_Topper1](https://discuss.elastic.co/u/Mike_Topper1)\
**Post date:** [August 11, 2014, 5:29pm UTC](https://discuss.elastic.co/t/using-a-nested-object-field-in-a-multi-match-query/19201/1 "2014-08-11T17:29:10Z")

</div>

Hello,

I'm having trouble coming up with how to supply a field within a nested  
object in the multi\_match fields list. I'm using the multi\_match query in  
order to perform query time field boosting, but something like:

"query": {  
"multi\_match": {  
"query": "China Mieville",  
"operator": "and",  
"fields": [  
"\_all", "title^2", "author.name^1.5"  
]  
}  
}

doesn't seem to work. the title is boosted fine but in fact if i take out  
the "\_all" field then i can see that author.name is never being used. is  
there a way to supply nested fields within a multi\_match query?

-Mike

--  
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/CALdNed%2B4VHQZE%2B%3DCqihZtH223DXR5MR9u49%2BessQ6ybpYbB%3DNg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALdNed%2B4VHQZE%2B%3DCqihZtH223DXR5MR9u49%2BessQ6ybpYbB%3DNg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![thomas\_vaughan](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@thomas\_vaughan](https://discuss.elastic.co/u/thomas_vaughan)\
**Post date:** [December 10, 2014, 7:33pm UTC](https://discuss.elastic.co/t/using-a-nested-object-field-in-a-multi-match-query/19201/2 "2014-12-10T19:33:12Z")

</div>

On Monday, August 11, 2014 1:29:56 PM UTC-4, Mike Topper wrote:

> Hello,
> 
> I'm having trouble coming up with how to supply a field within a nested  
> object in the multi\_match fields list. I'm using the multi\_match query in  
> order to perform query time field boosting, but something like:
> 
> "query": {  
> "multi\_match": {  
> "query": "China Mieville",  
> "operator": "and",  
> "fields": [  
> "\_all", "title^2", "author.name^1.5"  
> ]  
> }  
> }
> 
> doesn't seem to work. the title is boosted fine but in fact if i take out  
> the "\_all" field then i can see that author.name is never being used. is  
> there a way to supply nested fields within a multi\_match query?

I've just been bit by this too. Anyone know how to make this work?

Thanks.

-Tom

--  
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/79272696-3745-4ce7-93e3-44d5b4cdd75e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/79272696-3745-4ce7-93e3-44d5b4cdd75e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![thomas\_vaughan](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@thomas\_vaughan](https://discuss.elastic.co/u/thomas_vaughan)\
**Post date:** [December 30, 2014, 8:54pm UTC](https://discuss.elastic.co/t/using-a-nested-object-field-in-a-multi-match-query/19201/3 "2014-12-30T20:54:29Z")

</div>

On Wednesday, December 10, 2014 4:33:12 PM UTC-3, [thomas....@beatport.com](mailto:thomas....@beatport.com)  
wrote:

> On Monday, August 11, 2014 1:29:56 PM UTC-4, Mike Topper wrote:
> 
> > Hello,
> > 
> > I'm having trouble coming up with how to supply a field within a nested  
> > object in the multi\_match fields list. I'm using the multi\_match query in  
> > order to perform query time field boosting, but something like:
> > 
> > "query": {  
> > "multi\_match": {  
> > "query": "China Mieville",  
> > "operator": "and",  
> > "fields": [  
> > "\_all", "title^2", "author.name^1.5"  
> > ]  
> > }  
> > }
> > 
> > doesn't seem to work. the title is boosted fine but in fact if i take  
> > out the "\_all" field then i can see that author.name is never being  
> > used. is there a way to supply nested fields within a multi\_match query?
> 
> I've just been bit by this too. Anyone know how to make this work?

In our case we switched the mapping type from "nested" to "object" and then  
this worked. I'm aware of the implications of this switch. We don't need  
the features provided by "nested". Others may, of course.

Thanks.

-Tom

> 

--  
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/857a9674-4661-4730-9ec8-79ba3426a603%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/857a9674-4661-4730-9ec8-79ba3426a603%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:41am UTC](https://discuss.elastic.co/t/using-a-nested-object-field-in-a-multi-match-query/19201/4 "2017-07-06T00:41:24Z")

</div>


