Search code examples
lucenesolrsolrjdataimporthandlerdih

Solr how to remove physically deleted documents with DataImportHandler


I've read solr wiki and I know it is possible to use deletedPkQuery to remove the documents which deleted logically, but how to remove physically deleted documents with DataImportHandler?


Solution

  • You can do it by optimizing the index. Send an optimize request to Solr as described here. But beware, that optimizing the index means re-writing the index. Unless you have substantial number of deleted documents in the index, the overhead of optimizing can be quite high.