Dan Klco created OAK-9715:
-----------------------------
Summary: IndexDefMergerUtils Uses Incorrect Index Name for merges
Property
Key: OAK-9715
URL: https://issues.apache.org/jira/browse/OAK-9715
Project: Jackrabbit Oak
Issue Type: Improvement
Components: oak-run
Affects Versions: 1.42.0
Reporter: Dan Klco
*Problem*
The IndexDefMergerUtils uses the ancestorName and customName values for setting
the merges property when merging an index instead of the latest product Index
Name and custom name.
*Example*
Given the following indexes:
newIndexes: [index-2]
allIndexes: [index-1, index-1-custom-1]
Calling IndexDefMergerUtils.merge(newIndexes, allIndexes) would result in an
index with the property:
index-2-custom-1: {
merges: [index-1, index-1-custom-1]
}
*Result*
When the new index-2 definition is loaded, the index-1 definition in the
repository will be superseded and no longer be active. Since the [IndexName
class|https://github.com/apache/jackrabbit-oak/blob/45e05adb16ce65b2867b0de48a86291a8f01720d/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/IndexName.java#L248]
will only consider an index active if every index it references in the merges
property is either active, disabled or removed, the new index-2-custom-1 index
will not be active and therefore not considered for queries.
*Expected Result*
The merged index will be created in a way that the new custom indexes are
considered for queries once the merged version of the base index is active.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)