public void testResultSet() throws RepositoryException {
createNodes(testRootNode, 10, 5, 0);
superuser.save();
SearchIndex index = (SearchIndex) getQueryHandler();
int resultFetchSize = index.getResultFetchSize();
try {
String stmt = testPath + "//*[@" + jcrPrimaryType + "] order by @jcr:score descending";
// with result fetch size Integer.MAX_VALUE
readResult(executeQuery(stmt));
// with result fetch size 100
index.setResultFetchSize(100);
readResult(executeQuery(stmt));
// with 100 limit
QueryImpl query = (QueryImpl) qm.createQuery(stmt, Query.XPATH);
query.setLimit(100);
readResult(query.execute());
} finally {
index.setResultFetchSize(resultFetchSize);
}
for (NodeIterator it = testRootNode.getNodes(); it.hasNext(); ) {
it.nextNode().remove();
superuser.save();