Query Builder API | Community
Skip to main content
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 kautuk_sahni

Adding more reference here:

Read this community user's blog: http://www.aemcq5tutorials.com/tutorials/adobe-aem-cq5-tutorials/aem-query-builder

//

AEM comes with a Query Debugger tool using which you can execute search queries on the JCR (Java Content Repository).  Use this tool for the dry run for your AEM queries optimize them and then implement it in the code. AEM Query Builder debugger URL:- http://localhost:4502/libs/cq/search/content/querydebug.html

Debugging AEM Query Logs:- Debugging AEM query is very critical when you are looking for its performance or any error in aem query. Follow below steps to enable AEM Query Debugger:- Navigate to http://localhost:4502/system/console/slinglog. Click on Add new logger (It might be useful to create a new log file for the query, you can use any existing log file also.) Enter Logfile Name(query.log). Set Log level to Debug or Trace. TRACE will also show filtering per node (useful when writing custom filtering) Avoid DEBUG or lower log level in the production environment. Add below 3 class files for debugging.

Reference post:- CQ-OPS - How to Use CQ's Query Debugger Tool

~kautuk

2 replies

kautuk_sahni
kautuk_sahniAccepted solution
Employee
September 18, 2017

Adding more reference here:

Read this community user's blog: http://www.aemcq5tutorials.com/tutorials/adobe-aem-cq5-tutorials/aem-query-builder

//

AEM comes with a Query Debugger tool using which you can execute search queries on the JCR (Java Content Repository).  Use this tool for the dry run for your AEM queries optimize them and then implement it in the code. AEM Query Builder debugger URL:- http://localhost:4502/libs/cq/search/content/querydebug.html

Debugging AEM Query Logs:- Debugging AEM query is very critical when you are looking for its performance or any error in aem query. Follow below steps to enable AEM Query Debugger:- Navigate to http://localhost:4502/system/console/slinglog. Click on Add new logger (It might be useful to create a new log file for the query, you can use any existing log file also.) Enter Logfile Name(query.log). Set Log level to Debug or Trace. TRACE will also show filtering per node (useful when writing custom filtering) Avoid DEBUG or lower log level in the production environment. Add below 3 class files for debugging.

Reference post:- CQ-OPS - How to Use CQ's Query Debugger Tool

~kautuk

Kautuk Sahni
edubey
New Participant
September 17, 2017

Query Builder docs suggests two ways Query Builder API

Testing and Debugging

https://docs.adobe.com/docs/en/aem/6-3/develop/search/querybuilder-api.html#Testing and Debugging

Debugging Queries with Logging

https://docs.adobe.com/docs/en/aem/6-3/develop/search/querybuilder-api.html#Debugging Queries with Logging

Go through them, it should be sufficient. If not, reply back here.

Thanks