diff --git a/README.md b/README.md index 4acfbe2..a949c2f 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,9 @@ Further details in . +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 . + +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 . # Usage with Maven diff --git a/src/test/java/biz/netcentric/filevault/validator/aem/cloud/AemCloudValidatorTest.java b/src/test/java/biz/netcentric/filevault/validator/aem/cloud/AemCloudValidatorTest.java index 099fcdb..d83781e 100644 --- a/src/test/java/biz/netcentric/filevault/validator/aem/cloud/AemCloudValidatorTest.java +++ b/src/test/java/biz/netcentric/filevault/validator/aem/cloud/AemCloudValidatorTest.java @@ -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