Expand my Community achievements bar.

DAMassetLucene is not getting picked

Avatar

Level 3

Hi Guys,

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

Thanks

Harish

LuceneLogs.PNG

5 Replies

Avatar

Employee

Hi Harish,

Your query requires an indexed propety for dam:Asset as jcr:primaryType:

  - async = "async"

  - jcr:primaryType = oak:QueryIndexDefinition

  - evaluatePathRestrictions = true

  - type = "lucene"

  + indexRules

   + dam:Asset

    + properties

     + primaryType

      - name = "jcr:primaryType"

      - propertyIndex = true

     + lastModified

      - name = "jcr:content/jcr:lastModified"

      - ordered = true

OOTB /oak:index/damAssetLucene does not have such a property.

You should add something like:

1540064_pastedImage_4.png

Reindex and re-try your test.

Regards,

Avatar

Level 3

Hi Berlient,

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.

Thanks

Harish

Avatar

Employee Advisor

Hi berliant

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?

Avatar

Level 3

HI Jörg Hoh

I tried that as well.

The name of the string used is already as you have asked .

Thanks

Harish

1540796_pastedImage_0.png

Avatar

Level 3

Did you got any success my dam:asset is also not getting picked up