# Help: How to apply dismax query on both parent and nested objects

**URL:** <https://discuss.elastic.co/t/help-how-to-apply-dismax-query-on-both-parent-and-nested-objects/97175>\
**Category:** Elasticsearch\
**Created:** [August 16, 2017, 3:52am UTC](https://discuss.elastic.co/t/help-how-to-apply-dismax-query-on-both-parent-and-nested-objects/97175 "2017-08-16T03:52:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![king](https://avatars.discourse-cdn.com/v4/letter/k/a9adbd/32.png) [@king](https://discuss.elastic.co/u/king)\
**Post date:** [August 16, 2017, 3:52am UTC](https://discuss.elastic.co/t/help-how-to-apply-dismax-query-on-both-parent-and-nested-objects/97175/1 "2017-08-16T03:52:33Z")

</div>

I have an uncommon case of searching one term on both parent's attribute and its nested object's attribute, and get the max out of them.  
Example:

Parent document has the following attributes:

- name
- birth year
- addresses

The attribute "addresses" is an array containing nested objects having these attributes:

- street
- zip code

A search of a four digits number should look at both "birth year" attribute of parent document and "zip code" attribute of the nested addresses.

---

<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:** [September 13, 2017, 3:52am UTC](https://discuss.elastic.co/t/help-how-to-apply-dismax-query-on-both-parent-and-nested-objects/97175/2 "2017-09-13T03:52:34Z")

</div>

Closed on September 13, 2017, 3:52am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
