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
New Participant
January 31, 2022
Solved

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

  • January 31, 2022
  • 2 replies
  • 2066 views

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.
Best answer by lukasz-m

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.

2 replies

New Participant
January 31, 2022

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

 

 

 

 

 

 

lukasz-m
New Participant
January 31, 2022

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.

santhosh_kumark
New Participant
January 31, 2022

Hi @lukasz-m ,

 

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

lukasz-m
lukasz-mAccepted solution
New Participant
January 31, 2022

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.