cq:PageContent not getting retrieved





Suddenly we are not getting any result for SQL2 query like this:

select * from [cq:PageContent] as data WHERE ISDESCENDANTNODE(data,'/content/experience-fragments/')


whereas this works and return nodes:

select * from [cq:Page] as data WHERE ISDESCENDANTNODE(data,'/content/experience-fragments/')


I created cq:PageContent under experience-fragment folder but still no luck..did re-index cq:PageLucene as well.


Any pointer..?

Accepted Solutions (1)

Accepted Solutions (1)




Hi @Mayukh007,

I could see it working in 6.5.0. Couldn't check with SP5

As a first step, can you try to execute the below query predicate set in querydebug.html(http://localhost:4502/libs/cq/search/content/querydebug.html) and also in Explain Query (Tools -> Operations -> Diagnosis -> Query Performance)




 Still no clue, create a logger for following in Sling -> Log support in Felix console (http://localhost:4502/system/console/slinglog)-> Execute the query again and share the details from log


Thank you for the suggestion.

I tried above steps but still clueless. One more thing, it only does not work for under /content/experience-fragment folder.

So here is what is working and what is not:

select * from [cq:PageContent] as data WHERE ISDESCENDANTNODE(data,'/content/experience-fragments/') = no result

select * from [nt:unstructured] as data WHERE ISDESCENDANTNODE(data,'/content/experience-fragments/') = gives result

select * from [cq:PageContent] as data WHERE ISDESCENDANTNODE(data,'/content/') = gives result too

select * from [cq:PageContent] as data WHERE CONTAINS([cq:tags],"cm-travel:XFTYPE/FAMILYDEP") AND ISDESCENDANTNODE(data,'/content/experience-fragments') AND [sling:resourceType] = "core/wcm/components/page/v1/page" = this works as well

Hi @Mayukh007,

I could spot one trivial difference between your working query and the one doesn't works. It really didn't matter when I tried from my instance.

Given that it is not working for you anyway, I suggest you to try this

  • Remove "/" after experience-fragments and try. The other working query with check on cq:tags along with experience fragments check that you mentioned is not having the same. 
  • select * from [cq:PageContent] as data WHERE ISDESCENDANTNODE(data,'/content/experience-fragments')  

Still no clue,

  • Share screenshot of CRXDE view of /content/experience-fragments path if possible
  • Observe and share log details while executing this query.
  • Hope you are trying this with admin access. (Should be, as your last query works. Just to mention as one of the possible reason)
Thank you again for the suggestions. I actually found that the issue is in new custom oak index we added...So I think we are good now, I need to debug the index to find root cause.
With OOB set up, this query is a traversal query. Given that you have used custom oak index definition + with results of working and not working query, check for path related properties added as part of custom index definition. (Could relate now with query results that you posted - first and last query)
yes, the custom index did not have the path we were searching in that query. Will check by adding that in that custom query. Currently this SQL2 query not using any custom index.

Answers (1)

Answers (1)




Below query provides expected result on AEM 6.5, can you please check error log when this query returns no result for you & also if possible share some screenshot of no result.