-
Type: New Feature
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2025.x
-
Component/s: Elasticsearch
-
Epic Link:
-
Tags:
-
Sprint:nxplatform #112, nxplatform #113, nxplatform #114
-
Story Points:8
Add a new Domain Event Producer (DEP) for indexing that produces an event describing what needs to be reindexed on transaction completion.
The DEP will implement the same logic as the current IndexingCommandsStacker to build a list of indexing commands corresponding to the transaction.
An indexing command describes:
- What action to perform? index or delete
- Which documents to process?
- a document, eventually with its related documents: proxies, previous version (to update the isLastVersion prop)
- a document and all its descendants, this happens in case of security update, move, copy or delete a folder.
- only direct children of a document, this happens in case of ordered folder (childrenOrderChanged)
- When to index:
- synchronously, in the case the next transaction needs to immediately find the update documents, this could be limited to few documents only
- asynchronously
Note that Nuxeo is always indexing the entire document. Partial indexing could make sense for mass update when changing content ordering, propagating read acls change. First it’s risky: conflict could easily create corrupted document representation, harder to pinpoint than desynchronisation, second it’s not necessarily faster, because the entire document is probably already loaded and behind the scene at elastic level it’s a delete and insert generating the same disk IO.
Each command is written to a `source/indexing` stream, we use multiple partition for this stream, all indexing command from the same transaction should goes to the same partition, a UUID v7 (time ordered uuid) can be used as Record key.