Deploy my custom oak index for publish | Community
Skip to main content
Level 2
May 9, 2025

Deploy my custom oak index for publish

  • May 9, 2025
  • 3 replies
  • 829 views

I deployed the index in my AEM project, it works in Author but it's not working in Publish.



<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:dam="http://www.day.com/dam/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:rep="internal"
jcr:mixinTypes="[rep:AccessControllable]"
jcr:primaryType="oak:QueryIndexDefinition"
async="[async,nrt]"
compatVersion="{Long}2"
evaluatePathRestrictions="{Boolean}true"
includedPaths="[/content/dam/project/master/pt/pages,/content/dam/project/master/en/pages,/content/dam/project/master/es/pages,/content/dam/project/master/pt/components/central-de-ajuda/faqs/categories,/content/dam/project/master/en/components/central-de-ajuda/faqs/categories,/content/dam/project/master/es/components/central-de-ajuda/faqs/categories]"
maxFieldLength="{Long}100000"
type="lucene"
tags="[visualSimilaritySearch]">
<facets
jcr:primaryType="nt:unstructured"
secure="insecure"
topChildren="100"/>
<indexRules jcr:primaryType="nt:unstructured">
<dam:Asset jcr:primaryType="nt:unstructured">
<properties jcr:primaryType="nt:unstructured">
<customIndexedData
jcr:primaryType="nt:unstructured"
name="jcr:content/data/master/customIndexedData"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}false"
analyzed="{Boolean}true" />
<title
jcr:primaryType="nt:unstructured"
name="jcr:content/data/master/title"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}false"
analyzed="{Boolean}true" />
<seoTitle
jcr:primaryType="nt:unstructured"
name="jcr:content/data/master/seoTitle"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}false"
analyzed="{Boolean}true" />
<seoDescription
jcr:primaryType="nt:unstructured"
name="jcr:content/data/master/seoDescription"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}false"
analyzed="{Boolean}true" />
<answer
jcr:primaryType="nt:unstructured"
name="jcr:content/data/master/answer"
nodeScopeIndex="{Boolean}true"<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:dam="http://www.day.com/dam/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:rep="internal"
jcr:mixinTypes="[rep:AccessControllable]"
jcr:primaryType="oak:QueryIndexDefinition"
async="[async,nrt]"
compatVersion="{Long}2"
evaluatePathRestrictions="{Boolean}true"
includedPaths="[/content/dam/project/master/pt/pages,/content/dam/project/master/en/pages,/content/dam/project/master/es/pages,/content/dam/project/master/pt/components/central-de-ajuda/faqs/categories,/content/dam/project/master/en/components/central-de-ajuda/faqs/categories,/content/dam/project/master/es/components/central-de-ajuda/faqs/categories]"
maxFieldLength="{Long}100000"
type="lucene"
tags="[visualSimilaritySearch]">
<facets
jcr:primaryType="nt:unstructured"
secure="insecure"
topChildren="100"/>
<indexRules jcr:primaryType="nt:unstructured">
<dam:Asset jcr:primaryType="nt:unstructured">
<properties jcr:primaryType="nt:unstructured">
<customIndexedData
jcr:primaryType="nt:unstructured"
name="jcr:content/data/master/customIndexedData"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}false"
analyzed="{Boolean}true" />
<title
jcr:primaryType="nt:unstructured"
name="jcr:content/data/master/title"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}false"
analyzed="{Boolean}true" />
<seoTitle
jcr:primaryType="nt:unstructured"
name="jcr:content/data/master/seoTitle"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}false"
analyzed="{Boolean}true" />
<seoDescription
jcr:primaryType="nt:unstructured"
name="jcr:content/data/master/seoDescription"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}false"
analyzed="{Boolean}true" />
<answer
jcr:primaryType="nt:unstructured"
name="jcr:content/data/master/answer"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}false"
analyzed="{Boolean}true" />
<question
jcr:primaryType="nt:unstructured"
name="jcr:content/data/master/question"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}false"
analyzed="{Boolean}true" />
</properties>
</dam:Asset>
</indexRules>

<analyzers jcr:primaryType="nt:unstructured">
<default jcr:primaryType="nt:unstructured">
<tokenizer jcr:primaryType="nt:unstructured" name="standard" />
<filters jcr:primaryType="nt:unstructured">
<lowercase jcr:primaryType="nt:unstructured" />
<asciifolding jcr:primaryType="nt:unstructured" />
</filters>
</default>
</analyzers>

 

<tika jcr:primaryType="nt:unstructured">
<config.xml jcr:primaryType="nt:file"/>
</tika>
</jcr:root>

propertyIndex="{Boolean}false"
analyzed="{Boolean}true" />
<question
jcr:primaryType="nt:unstructured"
name="jcr:content/data/master/question"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}false"
analyzed="{Boolean}true" />
</properties>
</dam:Asset>
</indexRules>

<analyzers jcr:primaryType="nt:unstructured">
<default jcr:primaryType="nt:unstructured">
<tokenizer jcr:primaryType="nt:unstructured" name="standard" />
<filters jcr:primaryType="nt:unstructured">
<lowercase jcr:primaryType="nt:unstructured" />
<asciifolding jcr:primaryType="nt:unstructured" />
</filters>
</default>
</analyzers>

 

<tika jcr:primaryType="nt:unstructured">
<config.xml jcr:primaryType="nt:file"/>
</tika>
</jcr:root>

3 replies

Level 4
May 9, 2025

Hi @joelso3 ,

Here’s how you can troubleshoot and fix the issue where your custom AEM index works in Author but not in Publish:

 

Step 1: Ensure Proper Deployment to Publish

Check that the index node exists on Publish:

Path: /oak:index/your-index-name
Use: http://<publish-host>:<port>/crx/de
Confirm `filter.xml` includes the index:

xml
<filter root="/oak:index/your-index-name" />

Ensure it's not excluded in a runmode-specific filter like `filter.author.xml`.

 

Step 2: Force Reindexing on Publish

 Add these properties to the index node:

xml
reindex="{Boolean}true"
reindexCount="{Long}1"

Redeploy and restart AEM Publish


OR trigger reindex via JMX:

/system/console/jmx
Look under: org.apache.jackrabbit.oak:type=LuceneIndex,name=your-index-name
Use the reindex() method

 

Step 3: Check Index Status on Publish

Go to: /system/console/jmx
Find your index under:

org.apache.jackrabbit.oak:type=LuceneIndex,name=your-index-name
Verify:

Status = ACTIVE
Size > 0 (documents are indexed)
Reindex = `false` (after initial index build completes)

 

Step 4: Confirm Index Usage in Queries

Go to:
http://<publish-host>:<port>/libs/granite/operations/content/diagnosistools/queryPerformance.html
Run your query and Check:

If your custom index is listed under "Indexes Used"
If results are being returned

 

Step 5: Permissions on Publish

Check that service user or `anonymous` has **read access** to paths under `includedPaths`.

Use: `/useradmin` on Publish
Look for ACLs on:

/content/dam/project/master/...

 

Step 6: Check for Index Conflicts

Make sure no other index matches the same paths with higher priority.

Look in /oak:index
Check includedPaths and type of other indexes

 

Step 7: Validate analyzed, propertyIndex, nodeScopeIndex

Ensure they are used appropriately:

analyzed=true → for full-text search
propertyIndex=true → for exact match (not needed if full-text)
nodeScopeIndex=true → index applies at node level

 

 

Try them and let me know if something works.

Thanks.

 

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
May 9, 2025

Hi,

 

Is this on AEM as a Cloud Service? If so, why do you think the deployment is not going through?

It’s possible that the reindexing process is stuck. You can check this using the Repository Browser—if you're on AEM Cloud, you should be able to verify whether the index is present there.

 

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/developer-tools/repository-browser

 

Hope this helps

Esteban Bustamante
JoelSo3Author
Level 2
May 12, 2025

Yes, I am using AEM as a Cloud Service.

In the query performance, I can see that I am using my customized index




In the developer console, I can see that my index is present.
However, in the developer console on the publish environment, the oak:index folder is not visible, so I can't verify whether the index is there or not.

 

The same query in author gives me results, but in publish it returns empty.

May 12, 2025

Can you try debugging this by enabling logs for oak index in your publish instance. Add below classes in your log config.

 

org.apache.jackrabbit.oak.plugins.index
org.apache.jackrabbit.oak.query.stats.QueryRecorder,
com.day.cq.search

org.apache.jackrabbit.oak.query

 

https://experienceleague.adobe.com/en/docs/experience-manager-65/content/implementing/deploying/deploying/queries-and-indexing#troubleshooting-indexing-issues

 

I hope this will help to locate actual issue.

 

 

 

 

kautuk_sahni
Community Manager
Community Manager
June 26, 2025

@joelso3 Just checking in — were you able to resolve your issue?
We’d love to hear how things worked out. If the suggestions above helped, marking a response as correct can guide others with similar questions. And if you found another solution, feel free to share it — your insights could really benefit the community. Thanks again for being part of the conversation!

Kautuk Sahni