would guess that it is unlikely that the segment_N and segments.gen files were the only things lost, by the sound of it, but you can try using CheckIndex
.
You can run it from a command line something like:
java -ea:org.apache.lucene... org.apache.lucene.index.CheckIndex path/to/index -fix
Or you can invoke methods of it in your own implementation, something like:
Directory directory = FSDirectory.open(new File("path/to/index")); CheckIndex check = new CheckIndex(directory); CheckIndex.Satus status = check.checkIndex(); check.fixIndex(status);
Read full article from lucene - Solr segments.gen and segments_N file restore - Stack Overflow
No comments:
Post a Comment