Java – no segment * file found

I need to access the Lucene index (created by crawling several pages using nutch), but it gives the error shown above:

java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@/home/<path>: files:
    at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:516)
    at org.apache.lucene.index.IndexReader.open(IndexReader.java:185)
    at org.apache.lucene.index.IndexReader.open(IndexReader.java:148)
    at DictionaryGenerator.generateDict(DictionaryGenerator.java:24)
    at DictionaryGenerator.main(DictionaryGenerator.java:56)

I went to Google, but the reason I gave didn't meet the requirements The fact that the file (path) is being displayed may mean that the directory is not empty thank you

Solution

Basically, the error message says Lucene can't find the correct file in the index directory I recommend checking the following:

>Verify that the path to the index directory matches your idea. > Do nutch and Lucene versions match? This may be due to version differences. > Is there a permission problem? Can you read the files in the directory? > Try using Luke to view the index If not, there may be some corruption in the index

If none of this helps, publish the index section of the code

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>