Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

cq:PageContent not getting retrieved

Avatar

Level 4

HI,

 

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..?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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)

 

path=/content/experience-fragments
type=cq:PageContent
p.limit=-1

 

 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

org.apache.jackrabbit.oak.query.QueryEngineImpl
org.apache.jackrabbit.oak.query.SQL2Parser
org.apache.jackrabbit.oak.query.QueryImpl
com.day.cq.search
org.apache.jackrabbit.oak.query

View solution in original post

8 Replies

Avatar

Correct answer by
Community Advisor

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)

 

path=/content/experience-fragments
type=cq:PageContent
p.limit=-1

 

 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

org.apache.jackrabbit.oak.query.QueryEngineImpl
org.apache.jackrabbit.oak.query.SQL2Parser
org.apache.jackrabbit.oak.query.QueryImpl
com.day.cq.search
org.apache.jackrabbit.oak.query

Avatar

Level 4

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

Avatar

Community Advisor

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)

Avatar

Level 4
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.

Avatar

Community Advisor
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)

Avatar

Level 4
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.

Avatar

Level 8

@Mayukh007 

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.

 

query-sql.PNG

 

query-debug.PNG

 

-Manjunath