Search code examples
solrluceneindexing

how to solve org.apache.lucene.index.CorruptIndexException error in Apache Solr?


Am using Apache Solr 3.1.0 with Lucene 3.1.0. While indexing server got stopped due to hardware failure. I restarted my server but solr indexing is not happening.

am getting

SEVERE: java.lang.RuntimeException: org.apache.lucene.index.CorruptIndexExceptio n: document count mismatch: deleted docs count 0 vs segment doc count 148 segmen t=_otm

It seems to be a bug in below 3.6 versions reference. But how to upgrade to higher version with out losing the old indexes.

How to solve this. Any body can tell me.


Solution

  • Upgrading won't fix your problem.

    Have a look at CheckIndex class. You can first run checkIndex() method (read-only) which would provide with the status information (CheckIndex.Status) and then you can run fixIndex(CheckIndex.Status status) in order to attempt to fix it. Good luck!