Elasticsearch documents
I'm having a hard time trying to fit hierachical documents into elasticsearch. Normally, one would denormalize this and have a flat structure, but that doesn't work.
The hierarchy:
dossiers -> contains 1 or more documents -> contains one or more pages.
I think this could be resolved with nested documents, and at first glance this seems to be the case (although it becomes a bit more difficult to update documents and pages, and aggregations as they all need to have nested paths and such)
Second, I still need to check if actual searching works correctly. I can search in dossier fields (title, summary), on document context (content of the complete document), and on page level (content of a single page).
The idea is to get a google-esque result page where matches are returned, in either the dossier, document, or on a specific page.
To make things a bit more difficult: documents CAN exists in multiple dossiers. I'm currently solving this by storing the same document multiple times, but I think i will run into issues as soon as I want to edit things.