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
Solved! Go to Solution.
Views
Replies
Total Likes
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
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:
Please assure that the propertynames including the node is correct related to the Parent node that we are searching for.
Hi Anachal,
Tested giving publishDate type attr of Date. Still no index were used.
Regards,
Eddie
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
Hello @ahli008
You have added evaluatePathRestrictions, but no paths are specified. Requesting you to please refer to damAssetLucene and configure IncludePaths and QueryPaths
Hi Aanchal,
Thank you very much.
IncludedPaths and queryPaths have been used and set to the same value. But still not used.
Regards,
Eddie
@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.
Views
Replies
Total Likes