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.