My goal is to index 'Documents Profiles' which all can hold multiple 'Document Files' and then execute a Full Text Search on the complete document returning with the _source of the Document Profile AND a highlight of the matching results.
The data model is something like this.
A 'Document profile' has some meta data like
- Revision
- Relations
- Etc.
A 'Document file' consists of things like
- Filename
- Filepath
- File Size
- File Metadata
- File Content
My first thought was to make the 'Document files' nested objects of the 'Document profile' and throw a nested query at it - but my experience has been that it's not possible to get a highlight of the 'File Content' hits with this type of mapping.
Are there any workarounds for this or do I need to make a Parent/Child relationship between the 'Document Profiles' and 'Document Files' instead and then throw multiple queries at ES and join the results in my application to obtain a Full Text Search working on both the 'Document Profile' and the 'Document Files' whilst returning with a highlighting?