I have the below working query
path=/content/dam type=sling:OrderedFolder nodename=[0-9][0-9][0-9][0-9]-([0-9][0-9][0-9][0-9]|[0-9][0-9][0-9][0-9][0-9]) property=jcr:content/metadataprofile property.operation=exists property.value=false p.limit=-1
It runs on entire Path=/content/dam, so it traverse all nodes for about 20 minutes and gives results.
How can i make it in batches when using query-builder API code-wise, like - traverse 1000 nodes and do-something code-wise and then continue with query and traversing next 1000 nodes and so-on ? Is it possible ?
Thanks in advance.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi,
You can combine offset, guessTotal and limit
https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/querybuilder-api.html
Views
Replies
Total Likes
Hi,
You can combine offset, guessTotal and limit
https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/querybuilder-api.html
Views
Replies
Total Likes
Views
Replies
Total Likes
you should use guess Total. Always set guessTotal to true unless you know your result set. This will make the result set small and counting it will be fast.
Use offset to set starting and ending point of result set.
int hits = 10;
int start = 0;
int offset = 3;// for example 4th set of result.
predicateMap.put("p.guessTotal", String.valueOf(offset + (6 * hits)));
Query query = queryBuilder.createQuery(PredicateGroup.create(predicateMap), session);
if (offset >= 0) {
start = offset;
}
query.setStart(start);
query.setHitsPerPage(hits);
Views
Replies
Total Likes
Views
Likes
Replies