I am attempting to use AEM's querybuilder API to do a generic search. The problem I am currently having is creating pagination with the querybuilder. While using the ResultPage
class in AEM with SearchResult to getNextPage()
. I am getting the result
com.day.cq.search.impl.result.ResultPageImpl@541bd4bf
. How would I convert this into a URL? I already am using the offset and result total with the querybuilder but cannot find any more documentation to put me in the right direction.
queryBuilder=resource.getResourceResolver().adaptTo(QueryBuilder.class);
//creating query based on the Query Description
Query query=queryBuilder.createQuery(PredicateGroup.create(map),session);
//Getting and storing the Results
List Pages1 = searchRes.getResultPages();
ResultPage nextpage = searchRes.getNextPage();
ResultPage lastpage = searchRes.getPreviousPage();
for (Hit hit:searchRes.getHits()){
String path1=hit.getPath();
String title1=hit.getTitle();
String excerpt1=hit.getExcerpt();