DAMassetLucene is not getting picked

HarishDv 01-08-2018

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

Mark Solution

Are these answers useful?
Help other community members by marking useful answers as accepted.

Accepted Solutions (0)

Answers (4)

Answers (4)

berliant
Employee
01-08-2018

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,

Jörg_Hoh
Employee
02-08-2018

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 01-08-2018

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