If you are running an SQL2 query in CRX 2.2 you may encounter the following exception:
org.apache.lucene.search.BooleanQuery$TooManyClauses: maxClauseCount is set to 1024
Running the query through the CRXDE Lite query window, or using QueryManager.createQuery will result in this error.
This error occurs if you are using the ISDESCENDANTNODE clause in your SQL2 query and there are too many child nodes in the result set. It is a bug in jackrabbit-core which is part of CRX 2.2.
This issue will be solved in future releases of CQ 5.5 and CRX.
The workaround for this issue is to split your SQL2 query into multiple queries to reduce the result set for each query, and then you can consolidate the results afterwards.