property index at nested level does not work | Community
Skip to main content
sreedobe
March 18, 2025
Solved

property index at nested level does not work

  • March 18, 2025
  • 4 replies
  • 1018 views

I am facing below issue about property indexing.

I have two property indexes (cqModel, cqTags )defined at "/content/dam/personal-site/oak:index".

 

Interesting thing is if I move these property indexes to '/oak:index" default out of the box location, property indexes picked by query. But not when indexes defined at "/content/dam/personal-site/oak:index".

 

content that needs indexing will be at /content/dam/personal-site/faqs folder.

 

 

sample queries to try:

 

 

select [jcr:path], [jcr:score], * from [dam:AssetContent] as a where [data/cq:model] = '/conf/pi/CF-Models/settings/dam/cfm/models/faq-model' and isdescendantnode(a, '/content/dam/pi/test-sreeni/faq2') select [jcr:path], [jcr:score], * from [dam:AssetContent] as a where [data/master/cq:tags] in('we-retail:gender', 'we-retail:activity') and isdescendantnode(a, '/content/dam/pi/test-sreeni/faq2') select [jcr:path], [jcr:score], * from [dam:AssetContent] as a where [data/cq:model] = '/conf/pi/CF-Models/settings/dam/cfm/models/faq-model' and [data/master/cq:tags] in('we-retail:gender', 'we-retail:activity') and isdescendantnode(a, '/content/dam/pi/test-sreeni/faq2')

 

 

Any ideas , what I am missing.

 

cc:  @joerghoh @arunpatidar 

Best answer by arunpatidar

@narendragandhi @arunpatidar 

 

I created below index at root /oak:index as part of ui.apps.

Does reindex="{Boolean}false" needs to be false or true ?

I have manually triggered indexing by setting reindex=true in my local aem.

But when I check the same index on upper environments,

I still see traversal queries in logs. note: if I execute the query from logs in "query performance , explain query" tool , it is picking the index. 

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:dam="http://www.day.com/dam/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:rep="internal" jcr:mixinTypes="[rep:AccessControllable]" jcr:primaryType="nt:unstructured"> <acme.damAssetContent-1-custom-1 jcr:primaryType="oak:QueryIndexDefinition" async="[async,nrt]" compatVersion="{Long}2" type="lucene" reindex="{Boolean}false" evaluatePathRestrictions="{Boolean}true" includedPaths="[/content/dam/acme]" queryPaths="[/content/dam/acme]" fullTextEnabled="{Boolean}false" tags="[piwebfragments]"> <indexRules jcr:primaryType="nt:unstructured"> <dam:AssetContent jcr:primaryType="nt:unstructured"> <properties jcr:primaryType="nt:unstructured"> <contentFragment jcr:primaryType="nt:unstructured" name="contentFragment" propertyIndex="{Boolean}true" type="Boolean"/> <model jcr:primaryType="nt:unstructured" name="data/cq:model" propertyIndex="{Boolean}true" type="String"/> </properties> </dam:AssetContent> </indexRules> </acme.damAssetContent-1-custom-1> </jcr:root>

 

 


Hi @sreedobe 

As per Oak Documentation it is not recommended to set reindex =true , because it does not bring significant benefits and cause performance issue.

https://jackrabbit.apache.org/oak/docs/query/indexing.html#reindexing 

 

Please check https://adapt.to/2024/schedule/indexing-in-aemaacs-behind-the-scenes to know how indexing works behind the scene.

4 replies

arunpatidar
Community Advisor
Community Advisor
March 18, 2025

Hi @sreedobe 

I believe AEM Store index definition at ui.apps/src/main/content/jcr_root/_oak_index

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

Could you please share the document which you are referring to create index?

Arun Patidar
sreedobe
sreedobeAuthor
March 18, 2025

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/operations/indexing#deploying-custom-index-definitions

I followed documentation and created oak indexes as part of ui.content rather than ui.apps , i do not think this matters as resulted oak:index stored at /content/dam/site/oak:index . please let me know.

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
March 25, 2025

@narendragandhi @arunpatidar 

 

I created below index at root /oak:index as part of ui.apps.

Does reindex="{Boolean}false" needs to be false or true ?

I have manually triggered indexing by setting reindex=true in my local aem.

But when I check the same index on upper environments,

I still see traversal queries in logs. note: if I execute the query from logs in "query performance , explain query" tool , it is picking the index. 

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:dam="http://www.day.com/dam/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:rep="internal" jcr:mixinTypes="[rep:AccessControllable]" jcr:primaryType="nt:unstructured"> <acme.damAssetContent-1-custom-1 jcr:primaryType="oak:QueryIndexDefinition" async="[async,nrt]" compatVersion="{Long}2" type="lucene" reindex="{Boolean}false" evaluatePathRestrictions="{Boolean}true" includedPaths="[/content/dam/acme]" queryPaths="[/content/dam/acme]" fullTextEnabled="{Boolean}false" tags="[piwebfragments]"> <indexRules jcr:primaryType="nt:unstructured"> <dam:AssetContent jcr:primaryType="nt:unstructured"> <properties jcr:primaryType="nt:unstructured"> <contentFragment jcr:primaryType="nt:unstructured" name="contentFragment" propertyIndex="{Boolean}true" type="Boolean"/> <model jcr:primaryType="nt:unstructured" name="data/cq:model" propertyIndex="{Boolean}true" type="String"/> </properties> </dam:AssetContent> </indexRules> </acme.damAssetContent-1-custom-1> </jcr:root>

 

 


Hi @sreedobe 

As per Oak Documentation it is not recommended to set reindex =true , because it does not bring significant benefits and cause performance issue.

https://jackrabbit.apache.org/oak/docs/query/indexing.html#reindexing 

 

Please check https://adapt.to/2024/schedule/indexing-in-aemaacs-behind-the-scenes to know how indexing works behind the scene.

Arun Patidar
narendragandhi
Community Advisor
Community Advisor
March 18, 2025

Hi @sreedobe 

 

Please refer the documentation - https://experienceleague.adobe.com/en/docs/experience-manager-learn/foundation/development/understand-indexing-best-practices

 

If you are trying to get this in AEM as a cloud service environment, you would need to change the index type to Lucene. Hope this helps!

 

Thanks

Narendra

giuseppebaglio
New Member
March 18, 2025

hi, in any case I recommend to have a look at Ensure Oak Index

kautuk_sahni
Community Manager
Community Manager
April 1, 2025

@sreedobe Did you find the suggestions helpful? Please let us know if you need more information. If a response worked, kindly mark it as correct for posterity; alternatively, if you found a solution yourself, we’d appreciate it if you could share it with the community. Thank you!

Kautuk Sahni