Delete documents in all collections using indexeradmin rdocs

208 Views Asked by At

Is it possible to use?

indexeradmin rdocs list-of-ids.txt

to delete all documents across all collections.

I ran the command but found it hadn't deleted the documents, from the docs it says to specify the collection name, I can delete the documents per collection but just wondered if it was possible to have a list of mixed internal_ids from different collections and have indexeradmin delete them all. For example a file containing:

  • 0034953453453453_collection1
  • 4345345345345334_collection2

would delete the documents in collection1 and 2.

1

There are 1 best solutions below

0
chaimp On

For each collection do this:

indexerinfo -a reportcontents collection-name > /tmp/list-of-ids.txt
indexeradmin --column=1 --row=1 rdocs /tmp/list-of-ids.txt collection-name session-id

Execute the second line for all columns/rows of the cluster. And you can choose any random integer for the session-id.