Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ Further details in <https://experienceleague.adobe.com/en/docs/experience-manage

## Enforce diff.index control nodes of type `disabled`

The control nodes `/oak:index/diff.index` and `/oak:index/diff.index.optimizer` used by Oak's simplified index management (diff indexes) are exempt from the naming, `type=lucene` and `compatVersion` rules above, but must have `type` set to `disabled`. Further details in <https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/operations/indexing#simplified-index-management-using-the-diff-index>.
The control nodes `/oak:index/diff.index` and `/oak:index/diff.index.optimizer` used by Oak's simplified index management (diff indexes) are exempt from the naming, `type=lucene` and `compatVersion` rules above, but must have `type` set to `disabled` when being of type `oak:QueryIndexDefinition`. Further details in <https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/operations/indexing#simplified-index-management-using-the-diff-index>.

Cloud Manager and the local AEM SDK/RDE require different wrappers for `/oak:index/diff.index`, which are usually switched via Maven profiles: the wrapper for Cloud Manager is of type `nt:unstructured` (with `type="lucene"` and both `includedPaths` and `queryPaths` set to a non-existing path) and not checked by this validator, while the wrapper for the local AEM SDK and RDE is an `oak:QueryIndexDefinition` with `type="disabled"`. Further details in <https://experienceleague.adobe.com/en/docs/experience-cloud-kcs/kbarticles/ka-41939>.

# Usage with Maven

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,18 @@ void testValidDiffIndexDefinitions() {
messages = new ArrayList<>();
Optional.ofNullable(validator.validate(node, context, true)).ifPresent(messages::addAll);
MatcherAssert.assertThat(messages, Matchers.empty());
// diff.index wrapper required by Cloud Manager (https://experienceleague.adobe.com/en/docs/experience-cloud-kcs/kbarticles/ka-41939)
properties = Arrays.asList(
new DocViewProperty2(NameConstants.JCR_PRIMARYTYPE, "nt:unstructured"),
new DocViewProperty2(NameFactoryImpl.getInstance().create(Name.NS_DEFAULT_URI, "type"), "lucene"),
new DocViewProperty2(NameFactoryImpl.getInstance().create(Name.NS_DEFAULT_URI, "includedPaths"), "/same"),
new DocViewProperty2(NameFactoryImpl.getInstance().create(Name.NS_DEFAULT_URI, "queryPaths"), "/same"),
new DocViewProperty2(NameFactoryImpl.getInstance().create(Name.NS_DEFAULT_URI, "async"), "async"));
node = new DocViewNode2(NameConstants.JCR_ROOT, properties);
context = new NodeContextImpl("/oak:index/diff.index", Paths.get("_oak_index/test"),Paths.get("./jcr_root"));
messages = new ArrayList<>();
Optional.ofNullable(validator.validate(node, context, true)).ifPresent(messages::addAll);
MatcherAssert.assertThat(messages, Matchers.empty());
}

@Test
Expand Down
Loading