Run AEM Query-builder query in batch | Community
Skip to main content
tarun11011991
Level 2
May 6, 2020 6:00 AM UTC
Solved

Run AEM Query-builder query in batch

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
May 6, 2020 8:22 AM UTC

3 replies

arunpatidar
arunpatidarAccepted solution
New Participant
May 6, 2020 8:22 AM UTC
Arun Patidar
tarun11011991
Level 2
May 19, 2020 12:06 PM UTC
Should i give P.limit and p.guessTotal as some random number OR should I assign guessTotal as SearchResult.getTotalMatches() ? As i don't want my code to stop after certain number of nodes and want it to run completely without missing any nodes. Can you share sample java code using implementing that?
Translate