0
votes

I need to re-index the documents in Solr cloud mode. I also do not have the dataSource for completely re-indexing the documents after deleting all documents. Also is there any way to take the backup of the documents and re-index using the contents taken as backup? If I use backup and restore using command like below, I could observe the documents are not re-indexed.

http://{solrhost:port}/solr/{collection}/replication?command=backup

Also how to delete all the documents of core in Solr Cloud Mode in Single command? The command below deletes the documents in one of the Shards. How to delete the documents in all 5 shards of the Solr cloud?

http://{Sorlhost:port}/solr/{collectionname}/update?stream.body=:&commit=true

2

2 Answers

0
votes

You can use the Collections API to backup and restore solr collections:

https://lucene.apache.org/solr/guide/6_6/collections-api.html#CollectionsAPI-backup

As for deleting all documents, you could use SolrJ and build a simple java application to connect to your cluster and execute a delete command using the query "*:*" to delete all things since that query will return all documents.

0
votes

In place of using the backup and restore option, you can use the reindex collection api. This will allow you to choose a source and destination index to reindex the data without any additional configs. This is good if you dont have the initial datasource. For more details on the same, refer this : https://lucene.apache.org/solr/guide/8_1/collections-api.html#reindexcollection