Solr – Clean up Index

PresidentsDay-EN-728x90 Braincert-AWS-Certified-SA-Professional-Practice-Exam

Sometimes you want to delete all the records from the Solr index without deleting the index directory.
This can be done by executing an http url :-

Or by posting data xml data :-


Cleaning data using Solrj :-

SolrServer server = null;
try {
server = new CommonsHttpSolrServer(masterIndexUrl);
server.commit(true, true);
server.optimize(true, true);
} catch (Exception e) {
try {
} catch (Exception e1) {


Leave a Reply

Your email address will not be published. Required fields are marked *