AEM 6.1 Search Options pagination using Xpath
I am create javax.jcr.Query using xpath. The issue with this is that it doesn't have Pagination support in the QueryResult unlike SearchResult from cq package.
I wanted to be able to get dynamic search fields and search.
constructing xpath is easy and I found the search is faster as well. Can Some one help to get the Pagination support in QueryResult or
Convert javax.jcr.Query to cq Query?
My current Code:
QueryManager qm=session.getWorkspace().getQueryManager();
Query query = qm.createQuery(xpathQuery.toString(), Query.XPATH);
QueryResult result = query.execute();
for (NodeIterator iterator = result.getNodes(); iterator.hasNext();) {
}
Also can you please confirm my understanding about xpath search is faster compared to querybuilder?
Thanks for your support