How to investigate search related issues in AEM

This video walks through the steps to investigate search related issues in AEM.

Hello, everyone. In this video, we will discuss the steps to investigate search-related issues in Adobe Experience Manager. We may encounter search-related issues while using AEM, like the search results are not appropriate, or the search is taking too long to be completed. In these cases, we will need to diagnose the problem. There are some collaterals that need to be captured for this purpose, like request and error logs, query logs, and explain query output. The request and error logs can be found in the logs folder of CRX quickstart directory, where the AEM instance is installed. To enable query logs, visit AEM Web Console Log Support page, and click on Add New Logger. Set log level as debug, and enter the name required for the log file in the log file field. Here we have named the file as query.log. Set the API name in logger field as shown. Once done, click on Save. The log file will be available inside the log folder with the given name. Once the query logs are captured, they can be used to analyze the query execution plan. Open this query log file inside the log folder and copy the query generated for the search performed. We can now use the built-in AEM explained query tool to analyze the query execution plan. Go to AEM homepage and click on Tools using the hammer icon on the left side of the screen. Now select Operations, and then click on Diagnosis. From this page select Query Performance. In the Query Performance page, click on Explain Query tab. In the Query field, place the query copied from the query log file. For example, here we have the query for our search, hiking. We can include the execution time and node count, if required. Now click on Explain button. This will give a detailed query execution plan, and will help us to investigate search-related problems in AEM. These logs and artifacts can also be shared with the AEM support team for further assistance. Thank you for watching this video. -