I want to know if anyone has experience of deleting millions of documents in Marklogic? At the moment I used the simple xqueries to fetch the document uri s which need to be deleted and then I use corb to batch the whole operation.
Is there a faster way to delete millions of documents once I have a list of Uris ?
There are several ways to tackle this. The first question is how you retrieve the document uri's? Best approach for that is using the URI lexicon, and cts:uris
or cts:uri-match
. Second is how you perform the delete. You could iterate over the found uri's, and call xdmp:document-delete
for each, but you might consider skipping all above, and revert to xdmp:collection-delete
alltogether. That seems to work very efficient. It does require you to have a unique collection label assigned, and it can be delete entirely..
HTH!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With