Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

AEM 6.5 Query Builder or CRX Query Tool not returning results for local environments

Avatar

Avatar
Validate 1
Level 1
jovidiaz
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
jovidiaz
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
jovidiaz
Level 1

06-05-2021

I am experiencing a weird issue, for some pieces of the content in some of our author local development environments we are getting no results for the queries.

Exactly the same queries are returning valid results in other local development environments and in DEV and STAGE ones as well.

My first guess is that it could a permissions issue, but locally we are using the admin user which should have full permissions over all the nodes.

The following is part of the query in XPATH version, it is not a complex query:

 

 

/jcr:root/[content_path]/jcr:content//*[(@sling:resourceType = '[component_resource_type]')]

 

 

I even tried creating content packages from the environments where it is working fine and installing in my local environment without luck.

I would focus on debugging the code further(despite I already did without luck) but the fact that it does not return any result in the CRX query tool neither, indicates me the problem should not be in the code.

Also I already reviewd the query plans and there is not difference between it in a working environment and my local environment.

Also I tried an offline reindex with the oak tool and nothing changed.

Has anyone experienced something like that?

query

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

518 likes

Total Posts

654 posts

Correct Reply

215 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

518 likes

Total Posts

654 posts

Correct Reply

215 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile
Vijayalakshmi_S
MVP

07-05-2021

Hi @jovidiaz,

As you are completely sure that it is not permission issue, I suggest to give a try on the below. 

 

Create a logger entry for the following in debug level in http://localhost:4502/system/console/slinglog

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

Vijayalakshmi_S_0-1620395565297.png

Also, Execute your query in Query Performance tool(http://localhost:4502/libs/granite/operations/content/diagnosistools/queryPerformance.html) and arrive at Index used. Try to reindex only that specific index by updating the property "reindex" to true and wait for some time to see the property updated to false and reindexCount update to next incremented value upon successful reindexing. (Refresh the index node after some time to see the property values updated automatically upon successful reindex)

Vijayalakshmi_S_0-1620396537520.png

 

Example: For the sample query you posted, ntBaseLucene is the index used. You can reindex only that particular index - /oak:index/ntBaseLucene

Note : Given that it is your local environment, you can reindex directly like this. 

 

Logs statements are displayed here and you can also check detailed trace from Sling Log as mentioned above. 

Vijayalakshmi_S_1-1620396361759.png

Answers (2)

Answers (2)

Avatar

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

570 likes

Total Posts

687 posts

Correct Reply

197 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

570 likes

Total Posts

687 posts

Correct Reply

197 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile
asutosh_jena
Level 10

06-05-2021

Hi @jovidiaz 

 

Have you tried to reindex using the oak tool using the steps mentioned here:

https://experienceleague.adobe.com/docs/experience-manager-learn/foundation/administration/use-oak-r...

 

If still this did not resolve the issue, try to copy the index from the working instance and put it on your instance and retry.

asutosh_jena_0-1620358423286.png

 

Thanks!

Avatar

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

518 likes

Total Posts

654 posts

Correct Reply

215 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

518 likes

Total Posts

654 posts

Correct Reply

215 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile
Vijayalakshmi_S
MVP

07-05-2021

Hi @jovidiaz,

Just realized from my screenshot in previous answer that the result count is 0. (After posting the answer :()

Ignore my previous answer with respect to Query Performance. (You can consider Logger entry)

Issue is with the query. path shouldn't be with jcr:content in this case because there won't be any further nodes (under jcr:content) which has the sling:resourceType to be the one(weretail/components/structure/page) that we are looking for.

Here is the correct query with screenshot

Vijayalakshmi_S_0-1620397117736.png