Skip to content

OAK-12244: index nodes that gain a mixin rule, delete stale docs when…#2949

Open
thomasmueller wants to merge 1 commit into
trunkfrom
OAK-12244
Open

OAK-12244: index nodes that gain a mixin rule, delete stale docs when…#2949
thomasmueller wants to merge 1 commit into
trunkfrom
OAK-12244

Conversation

@thomasmueller

@thomasmueller thomasmueller commented Jun 11, 2026

Copy link
Copy Markdown
Member

… mixin rule is lost (#2938)

TODO: right now the PR does a descendent-document delete if the primary type or mixin is changed / removed. This is incorrect and needs to be fixed.

When an existing node's applicable indexing rule changes at runtime (e.g. jcr:mixinTypes added or removed), FulltextIndexEditor did not update the index because propertiesChanged was never set — jcr:mixinTypes is not normally listed in a rule's property definitions.

Track wasIndexable (rule matched before) alongside isIndexable() (rule matches after). In leave(), act on transitions:

  • !wasIndexable && isIndexable(): node gained a rule → addOrUpdate
  • wasIndexable && !isIndexable(): node lost a rule → deleteDocuments

Tests added:

  • PropertyIndexCommonTest: two end-to-end integration tests (all backends)
  • LuceneIndexEditor2Test: two unit tests verifying writer.docs / writer.deletedPaths

… mixin rule is lost (#2938)

When an existing node's applicable indexing rule changes at runtime (e.g. jcr:mixinTypes
added or removed), FulltextIndexEditor did not update the index because propertiesChanged
was never set — jcr:mixinTypes is not normally listed in a rule's property definitions.

Track wasIndexable (rule matched before) alongside isIndexable() (rule matches after).
In leave(), act on transitions:
- !wasIndexable && isIndexable(): node gained a rule → addOrUpdate
- wasIndexable && !isIndexable(): node lost a rule → deleteDocuments

Tests added:
- PropertyIndexCommonTest: two end-to-end integration tests (all backends)
- LuceneIndexEditor2Test: two unit tests verifying writer.docs / writer.deletedPaths
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants