How to repair corrupted lucene index?

前端 未结 2 1999
广开言路
广开言路 2021-02-07 19:02

My server was power loss and lucene index was corrupted. I runned IndexChecker but it fail:

java -cp /home/dthoai/programs/paesia/checker/lucene-core-3.5.0.jar -         


        
2条回答
  •  死守一世寂寞
    2021-02-07 19:29

    It looks like the main directory file, segments_N is corrupted. This probably means that the power loss happened while a commit was running.

    If this is the case, this means that there is some chance that an older segments_N file is present in your directory, and that the referenced segments are still present and valid. If there is such a file, try to remove your corrupted segments_ls0l file and see:

    • whether Lucene manages to open the index,
    • what data you are missing.

    Otherwise, there are some threads one Lucene user mailing-list talking about regenerating the segments_N file.

    • http://www.gossamer-threads.com/lists/lucene/java-user/102493
    • http://www.gossamer-threads.com/lists/lucene/java-user/39744

    Make sure to backup your directory before performing any modification.

提交回复
热议问题