Why query builder not returning any results for type=dam:Asset even though assets primary type is dam:Asset | Community
Skip to main content
santhosh_kumark
Level 6
Jan 31, 2022 9:09 AM UTC
Solved

Why query builder not returning any results for type=dam:Asset even though assets primary type is dam:Asset

I have tried the below query in query builder but results showing up zero, I'm getting results only when I remove type=dam:Asset. I have verified in crx, the assets are of primary type dam:Asset only.

path=/content/dam/test
type=dam:Asset
p.limit=-1
p.guessTotal=true
property.value=ABC123
p.nodedepth=3
property=jcr:content/metadata/customProperty
p.hits=full

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
lukasz-m
lukasz-mAccepted solution
New Participant
Jan 31, 2022 3:54 PM UTC

By rebuild I mean to run reindex process. Please follow below steps:

  1. Open crx/de.
  2. Go to node /oak:index/damAssetLucene.
  3. Change reindex property to true, and save that change.
  4. Observe error.log - you will see appropriate message once reindex process will end up.

After above process is completed you can try to run your query once again to see if that helps.

4 replies

Level 3
Jan 31, 2022 4:25 PM UTC

Santhosh, 

Given query is working perfectly fine in my local instance, 

As suggested by @lukasz-m, check your indexes and additionally you should setup debug level logs at com.day.cq.search.impl.builder.QueryImpl (path), to further troubleshoot the issue. 

follow below ref documentation for more information..

Query Builder API | Adobe Experience Manager

 

 

 

 

 

 

Translate
lukasz-m
New Participant
Jan 31, 2022 12:19 PM UTC

Hi @santhosh_kumark, I have checked your query on my AEM instance by and it works fine. What I have observed locally, is that using type=dam:Asset will use damAssetLucene(/oak:index/damAssetLucene) index and when typed is removed completely I got information that it is traversal query.

So base on above I would suggest first to rebuild damAssetLucene(/oak:index/damAssetLucene), if this will not help maybe you will need to extend your index adding your custom property.

Translate
santhosh_kumark
Level 6
Jan 31, 2022 3:43 PM UTC

Hi @lukasz-m ,

 

Can you help me how to rebuild damAssetLucene(/oak:index/damAssetLucene) in AEM 6.5

Translate
lukasz-m
lukasz-mAccepted solution
New Participant
Jan 31, 2022 3:54 PM UTC

By rebuild I mean to run reindex process. Please follow below steps:

  1. Open crx/de.
  2. Go to node /oak:index/damAssetLucene.
  3. Change reindex property to true, and save that change.
  4. Observe error.log - you will see appropriate message once reindex process will end up.

After above process is completed you can try to run your query once again to see if that helps.

Translate