Elasticsearch documents

Created at 2023-06-05 16:08:33 (11 months ago)

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.

elasticsearch nested documents

About jaytaph

Codemuser extraordinaire

avatar Loves building crazy and insane stuff. Happiest when left alone. All I wanted was a Pepsi, just a Pepsi.
Joined:March 24, 2023
Following:2
Followers:2
Posts:46
Comments:3
Upvotes:4
RSS feed