No need to do fulltext search just search for assets based on meatdata.
1. Get all the assets which met metadata criteria, for example
2. From the result get the assets path and store in array list or Array.
3. loop through array/arrayList and get all the page references for assets one by one using below code.
ReferenceSearch rr = new ReferenceSearch();
Map map = rr.search(request.getResourceResolver(),assetPath);
If you want to use pagination for assets you can always use limit, offset with guesstotal.
If you want to use pagination for Pages, you can handle this with Java once you have results in resultSets you can use resultSet however you want.
Please let us know the exact requirement if it doesn't help.
So my properties are not defined for metadata. it could be multiple properties where the text matches, hence doing a full text search.
Secondly, I am searching for assets and pages together. out of the assets returned, i am fetching their references(pages) and returning these as well. Hence the issue with query builder pagination.
Third, I don't want to create the entire list in one shot as this may be a slow query and implement pagination using java.