Search Performance Tuning
CQ uses different API to perform search against repository including JCR Search, Query Builder API
Search Indexes in CQ is stored under
In order to debug JCR Search you can do following:
JCR Query Debug
Starting with CRX 2.3, there is an MBean which exposes query statistics. These statistics include the top long running queries. The MBean can be accessed via any JMX client or the built-in client in the OSGi web console:
http://HOST:PORT/system/console/jmx/com.adobe.granite%3Atype%3DQueryStat
In order to debug search through Query Builder, you can use following URL
HOST:PORT/libs/cq/search/content/querydebug.html
You can do following to improve search performance (Only if search performance is slow)
Set CRX Search Index's resultFetchSize param
Result Fetch Size Config
If the result set of a jcr query is large, then the loading the complete setand checking ACLs on them is quite expensive.
To remedy this, limit the fetch size to 50 as via the SearchIndex element in the workspace.xml:
<param name="resultFetchSize" value="50"/>
e.g.
<SearchIndex class="com.day.crx.query.lucene.LuceneHandler">
<param name="path" value="${wsp.home}/index"/>
<param name="resultFetchSize" value="50"/>
</SearchIndex>
Set the CRX Search cacheSize param
Search Cache Size Setting
The search cacheSize can also be set in the SearchIndex element in workspace.xml. Set this parameter to 100000:
<param name="cacheSize" value="100000" />
e.g.
<SearchIndex class="com.day.crx.query.lucene.LuceneHandler">
<param name="path" value="${wsp.home}/index"/>
<param name="resultFetchSize" value="50"/>
<param name="cacheSize" value="100000" />
</SearchIndex>
This parameter is documented here.