Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

custom lucene index not used by query in AEMaaCS

Avatar

Level 2

Hi community members,

 

I've created below custom oak:index in my local instance with aem-sdk 20230713T151945Z-230601.

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:tm="internal"
compatVersion="{Long}2"
async="async"
jcr:primaryType="oak:QueryIndexDefinition"
evaluatePathRestrictions="{Boolean}true"
type="lucene">
<indexRules jcr:primaryType="nt:unstructured">
<feedItem jcr:primaryType="nt:unstructured">
<properties jcr:primaryType="nt:unstructured">
<publishDate name="tm:publishDate" ordered="{Boolean}true" jcr:primaryType="nt:unstructured"/>
<isNotShown name="tm:doNotShow/tm:isNotShown" propertyIndex="{Boolean}true" jcr:primaryType="nt:unstructured"/>
</properties>
</feedItem>
</indexRules>
</jcr:root>

 

The index is created under /oak:index successfully. 

 

But when using queryPerformance to explain query:

/jcr:root/content/refdata/RssFeeds/ninecelebrity//element(*, tm:feedItem)[(tm:doNotShow/@tm:isNotShown = 'false')] order by @tm:publishDate descending

 

It says "No indexes were used. This is a traversal query.".

 

Anybody has idea why the created index not used in the query?

 

Best Regards,

 

Eddie 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
9 Replies

Avatar

Correct answer by
Community Advisor

Avatar

Level 2

Hi Arun,

 

Thanks for your reply.

The index has been named as mhp.news-1-custom-1 according to the naming pattern by Adobe. 

<prefix>.<indexName>-<productVersion>-custom-<customVersion>

 

Regards,

 

Eddie

 

 

 

Avatar

Community Advisor

Hello @ahli008 

 

Once the index is redeployed, please check the error.log, if the indexing was completed.

If in doubt, set reindex ="true" on the index, that should start the re-indexing.

 

Also, please refer to /oak:index/damAssetLucene

The type for a Date should look something like this:

aanchalsikka_0-1697636664605.png

 

Please assure that the propertynames including the node is correct related to the Parent node that we are searching for.

 

 

 


Aanchal Sikka

Avatar

Level 2

Hi Anachal,

 

Tested giving publishDate type attr of Date. Still no index were used.

 

Regards,

 

Eddie

Avatar

Community Advisor

@ahli008 

 

  1. Was the indexing completed after the changes were made?
  2. Can you please share the node structure of  tm:feedItem along with the properties

Aanchal Sikka

Avatar

Level 2

Hi Aanchal,

 

Yes, reindex completed after change.

The path to tm:feedItem is: /content/refdata/RssFeeds/ninesport.

tm:feedItem has below child nodes:

tm:doNotShow,  tm:doNotUpdate and tm:pinned.

 

Regards,

Eddie

Avatar

Community Advisor

Hello @ahli008 

 

You have added evaluatePathRestrictions, but no paths are specified. Requesting you to please refer to damAssetLucene and configure IncludePaths and QueryPaths


Aanchal Sikka

Avatar

Level 2

Hi Aanchal,

 

Thank you very much.

 

IncludedPaths and queryPaths have been used and set to the same value. But still not used.

 

Regards,

 

Eddie

Avatar

Administrator

@ahli008 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni