Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

DAMassetLucene is not getting picked

HarishDv
Level 3
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

4 Replies
berliant
Employee
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,

HarishDv
Level 3
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

Jörg_Hoh
Employee
Employee

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?

HarishDv
Level 3
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