Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

property index at nested level does not work

Avatar

Level 4

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.

 

sreedobe_0-1742277251542.png

 

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:  @Jörg_Hoh @arunpatidar 

9 Replies

Avatar

Community Advisor

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/depl... 

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

Arun Patidar

AEM LinksLinkedIn

Avatar

Level 4

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/operations/index...

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.

Avatar

Community Advisor

Hi @sreedobe 

Still not able to see the location, in the above article the index is created at /oak:index e.g. ui.apps/src/main/content/jcr_root/_oak_index/damAssetLucene-8-custom-1/.content.xml

 

Please check @giuseppebag recommendation for custom location.

Arun Patidar

AEM LinksLinkedIn

Avatar

Community Advisor

You can look at https://oakutils.appspot.com/generate/index to generate index by providing the queries. I would recommend to proceed with Lucene index as there are multiple properties you are using in queries.

Avatar

Level 4

@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>

 

 

Avatar

Community Advisor

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

AEM LinksLinkedIn

Avatar

Community Advisor

Hi @sreedobe 

 

Please refer the documentation - https://experienceleague.adobe.com/en/docs/experience-manager-learn/foundation/development/understan...

 

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

Avatar

Level 8

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

Avatar

Administrator

@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