You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Dan Klco (Jira)" <ji...@apache.org> on 2022/03/09 14:58:00 UTC
[jira] [Created] (OAK-9717) IndexDefMergerUtils Should not Remove Nodes From Product Index Definition
Dan Klco created OAK-9717:
-----------------------------
Summary: IndexDefMergerUtils Should not Remove Nodes From Product Index Definition
Key: OAK-9717
URL: https://issues.apache.org/jira/browse/OAK-9717
Project: Jackrabbit Oak
Issue Type: Improvement
Components: oak-run
Affects Versions: 1.42.0
Reporter: Dan Klco
*Problem*
The IndexDefMergerUtils will remove child nodes from merged custom index definitions when the child node is present in the ancestor and new product index, but not in the custom index.
*Example*
Given the following indexes:
{code}
newIndexes: {
index-2: {
indexRules: {
nt:base: {
property1: {
name: someproperty
}
}
}
}
}
allIndexes:
{
index-1: {
indexRules: {
nt:base: {
property1: {
name: someproperty
}
}
}
},
index-1: {
indexRules: {
nt:base: {
property2: {
name: someproperty
}
}
}
}
}
{code}
Calling IndexDefMergerUtils.merge(newIndexes, allIndexes) would result in an index with the property:
index-2-custom-1: {
indexRules: {
nt:base: {
property2: {
name: someproperty
}
}
}
merges: [index-2, index-1-custom-1]
}
*Result*
Removing node structures in the merging process could allow for catastrophic changes to an index definition by removing key property / node type definitions.
*Expected Result*
The merged index would contain all of the nodes defined in the product index. _However_ custom index definitions would still be able to alter definitions by adding new nodes or changing / adding / removing properties from the product definition.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)