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:
Additional Info:
Our custom Oak index file _oak_index/cqPageLucene-custom-1/.content.xml looks like this:
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!
Views
Replies
Total Likes
Custom Oak indexes should be placed in the ui.apps package under the path ui.apps/src/main/content/jcr_root/_oak_index/. This is the correct location, and you don't need a separate structure package for Oak indexes.
This page explains everything about preparing the new index definition, deploying custom index definitions, and the project configurations: https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/operations/index...
IMO to resolve your validation errors, you need to update your Maven POM files with specific configurations:
<plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<validatorsSettings>
<jackrabbit-packagetype>
<options>
<immutableRootNodeNames>apps,libs,oak:index</immutableRootNodeNames>
</options>
</jackrabbit-packagetype>
</validatorsSettings>
</configuration>
</plugin><plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
<configuration>
<allowIndexDefinitions>true</allowIndexDefinitions>
<properties>
<cloudManagerTarget>none</cloudManagerTarget>
<noIntermediateSaves>true</noIntermediateSaves>
</properties>
</configuration>
</plugin>The allowIndexDefinitions=true property is essential to allow Oak index definitions in the package.
3) Update your filter.xml to include the specific index path:
<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
<filter root="/oak:index/cqPageLucene-custom-1"/>
</workspaceFilter>noIntermediateSaves=true
allowIndexDefinitions=true
The warning about /content/dam not being covered suggests you have a filter entry pointing to content areas. Oak indexes should only reference /oak:index paths in your filters.
Views
Replies
Total Likes
Hello @georhe6 ,
My findings and the required fixes for the custom Oak index issue :
Correct Location for Custom Oak Indexes:
Custom Oak index definitions must be placed inside a content package that deploys to /oak:index.
Recommended structure:
ui.apps.structure/src/main/content/jcr_root/_oak_index/<index-name>/.content.xml
(Alternatively, placing this under ui.apps/src/main/content/jcr_root/_oak_index also works.)
Package Type Requirement:
The module containing the index must produce a content package. Using the older MIXED package type leads to validation errors.
Please ensure the module POM is configured with: packaging = content-package
Required Vault Filter:
The filter.xml must explicitly include the index root. For example:
Reason for the Maven Build Failures:
The index .content.xml must declare the oak namespace (xmlns:oak).
The parent node of the index cannot be typed as nt:folder, otherwise the index node type oak:QueryIndexDefinition is rejected.
FileVault validates prefixes strictly; since the folder name encodes “oak:”, the XML must declare that prefix.
Orphaned filter warnings occur when filter entries do not match the package roots.
Correct Index Definition Requirements:
Each index folder under _oak_index must contain a .content.xml with:
jcr:primaryType="oak:QueryIndexDefinition"
xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0"
Recommended Best Practice:
We suggest placing all custom Oak indexes inside a dedicated ui.apps.structure module. This keeps system-level content separate from application code and avoids packaging conflicts.
Expected Result:
Implementing the above changes will resolve:
XML namespace validation errors
Node type violations
Orphaned filter warnings
MIXED package-type warnings
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies