I am trying to query some assets (type = dam:Asset) within my AEM instance.
However even when i search for a simple xpath query such as below , the query is only picking the OOB /oak:index/lucene rather than the expected /oak:index/damAssetLucene .
/jcr:root/content/dam/my/custom/assets//element(*, dam:Asset) order by jcr:content/@jcr:lastModified descending
Kindly note that there are no custom indices in place. Please also find the logs attached for reference.
AEM version : 6.3 . Please let me knwo wha
Your query requires an indexed propety for dam:Asset as jcr:primaryType:
- async = "async"
- jcr:primaryType = oak:QueryIndexDefinition
- evaluatePathRestrictions = true
- type = "lucene"
- name = "jcr:primaryType"
- propertyIndex = true
- name = "jcr:content/jcr:lastModified"
- ordered = true
OOTB /oak:index/damAssetLucene does not have such a property.
You should add something like:
Reindex and re-try your test.
Thanks for your response.
Firstly the node dam:Asset was already available in my instance.
Secondly i re-ran the instance , by adding the name and property Index properties to the dam:Asset node.
But i still dont see my dam:Asset index being picked up.
From what I see you have a mismatch between the screenshot and the structure you outlined in the text. In the screenshot you added the "jcr:primaryType" to the index, while in text you recommended to add a "lastModified" property (which seems to be a better match for the question).
HarishDv Can you try again with lastModified property?