Lucene CheckIndex for the rescue

http://solr.pl/en/2011/01/17/checkindex-for-the-rescue/

here talks about how to check and rescue broken lucene indexes and segments.

Here is commands used by me:

to check whether segments are broken or not :

 


java -cp lucene-core-4.10.3.jar -ea:org.apache.lucene... org.apache.lucene.index.CheckIndex /data/es_storage/es_data/elasticsearch/nodes/0/indices/logstash-2015.01.28/2/index/
java -cp lucene-core-4.10.3.jar:/usr/share/elasticsearch/lib/lucene-core-4.10.3.jar:/usr/share/elasticsearch/lib/* -ea:org.apache.lucene... org.apache.lucene.index.CheckIndex /data/es_storage/es_data/elasticsearch/nodes/0/indices/logstash-2015.01.28/1/index/

 

to fix broken segments. (Remember that, this is probably cause some documents lost).


java -cp lucene-core-4.10.3.jar -ea:org.apache.lucene... org.apache.lucene.index.CheckIndex /data/es_storage/es_data/elasticsearch/nodes/0/indices/logstash-2015.01.28/2/index/ -fix
java -cp lucene-core-4.10.3.jar:/usr/share/elasticsearch/lib/lucene-core-4.10.3.jar:/usr/share/elasticsearch/lib/* -ea:org.apache.lucene... org.apache.lucene.index.CheckIndex /data/es_storage/es_data/elasticsearch/nodes/0/indices/logstash-2015.01.28/1/index/