Here is the structure of my index. An Event has many nested objects : documents, sites, and persons.
Some fields on some nested objects are copy_to to the root.
Events
|--- persons—names
|--- other fields
|
|———— Documents
--------- other fields
|
|———— Sites
---------- other fields
|
|———— Persons
-----------name (copied to the root)
------------- id
Now let's say I am doing a query string search.
If a document is returned BECAUSE it matched with persons_names I want to return only the inner_hit of the associated object, which is "persons" in that case. Note that there may be multiple persons in the document and I need to return exactly the one that matched, so this might be an issue because copy_to is an array that doesn't point to its associated nested object.
Of course I want the same thing to happen if the result matched because of a field copied from "sites" or "documents".
This way, I will be able to create a multi object search --> What I mean by that is that I will return either an event, document, site or person, depending what matched with the query.
How can I do that ? Feel free to redirect me to another approach to solve my multi-object search problem.