Home > Java, solr > How to solve org.apache.lucene.index.CorruptIndexException?

How to solve org.apache.lucene.index.CorruptIndexException?

If solr server stops while indexing is going on, we may get org.apache.lucene.index.CorruptIndexException error.

To solve this we have to use org.apache.lucene.index.CheckIndex class. We have to run this class to fix the corrupted indexes in solr.

1.  First take back up your indexed data
2.  Go to the directory where lucene-core.3.6.1.jar is there

3. then run this command
java -cp lucene-core-3.1.0.jar -ea:org.apache.lucene… org.apache.lucene.index.CheckIndex “your indexed directory path” –fix
in my case it is
java -cp lucene-core-3.1.0.jar -ea:org.apache.lucene… org.apache.lucene.index.CheckIndex “C:\Program Files\gisgraphy-3.0-beta2\solr\data\index” –fix

corruptedindex

As there are no corrupted indexes in my case it says “No problems were detected with this index”

If there are any corrupted indexes are there then those will be fixed with this command and solr will be working fine.

Advertisements
Categories: Java, solr
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: