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.
Parent document has the following attributes:
- birth year
The attribute "addresses" is an array containing nested objects having these attributes:
- 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.