Hi AEM Community,
We are trying to add a custom Oak index in our AEM as a Cloud Service project. We tried adding the index in both:
ui.apps package
ui.apps/structure (we created a structure folder inside ui.apps)
However, our Maven build fails with multiple errors and warnings. Here is the relevant part of the log:
[WARNING] ValidationViolation: Filter root's ancestor '/content/dam' is not covered by any of the specified dependencies nor a valid root. @ META-INF\vault\filter.xml, validator: jackrabbit-filter [WARNING] ValidationViolation: Package of type 'MIXED' is legacy. Use one of the other types instead! @ META-INF\vault\properties.xml, validator: jackrabbit-packagetype [ERROR] ValidationViolation: Invalid XML found: Given root node name 'oak:index' (implicitly given via filename) cannot be resolved. The prefix used in the filename must be declared as XML namespace in the child docview XML as well! @ jcr_root\_oak_index\.content.xml, validator: jackrabbit-docviewparser, JCR node path: /oak:index [WARNING] ValidationViolation: Found orphaned filter entries: entry with root '/apps', entry with root '/apps/customproject', entry with root '/apps/sling', entry with root '/apps/cq', entry with root '/apps/dam', entry with root '/apps/wcm', entry with root '/apps/msm', entry with root '/apps/settings', entry with root '/content/dam/customproject', validator: jackrabbit-filter [ERROR] ValidationViolation: Node 'cqPageLucene-custom-1 [oak:QueryIndexDefinition]' is not allowed as child of node with types [nt:folder]: Node type does not allow arbitrary child nodes and does not allow this specific name and node type either! @ jcr_root\_oak_index\cqPageLucene-custom-1, validator: jackrabbit-nodetypes, JCR node path: /oak:index/cqPageLucene-custom-1
Additional Info:
<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" jcr:primaryType="oak:QueryIndexDefinition" type="lucene" async="[async,nrt]" compatVersion="{Long}2" evaluatePathRestrictions="{Boolean}true" includedPaths="[/content/project]" queryPaths="[/content/project]" tags="[PageSearch]" reindex="{Boolean}true" reindexCount="{Long}1"> <aggregates jcr:primaryType="nt:unstructured"> <cq:Page jcr:primaryType="nt:unstructured"> <include0 jcr:primaryType="nt:unstructured" path="jcr:content" relativeNode="{Boolean}true"/> </cq:Page> <cq:PageContent jcr:primaryType="nt:unstructured"> <include0 jcr:primaryType="nt:unstructured" path="*"/> <include1 jcr:primaryType="nt:unstructured" path="*/*"/> <include2 jcr:primaryType="nt:unstructured" path="*/*/*"/> </cq:PageContent> </aggregates> <indexRules jcr:primaryType="nt:unstructured"> <cq:Page jcr:primaryType="nt:unstructured"> <properties jcr:primaryType="nt:unstructured"> <allProps jcr:primaryType="nt:unstructured" name=".*" isRegexp="{Boolean}true" nodeScopeIndex="{Boolean}true" analyzed="{Boolean}true" useInSpellcheck="{Boolean}true"/> <cqTags jcr:primaryType="nt:unstructured" name="jcr:content/cq:tags" nodeScopeIndex="{Boolean}true" propertyIndex="{Boolean}true" analyzed="{Boolean}false" type="String"/> </properties> </cq:Page> </indexRules> </jcr:root>
Questions:
Where is the correct location for custom Oak indexes in AEM as a Cloud Service?
Do we need a separate structure package, or can it exist inside ui.apps?
How do we avoid the validation errors when packaging _oak_index with Maven?
Any guidance or examples of a working structure for custom Oak indexes in AEM Cloud Service would be greatly appreciated.
Thank you in advance!