no segments* file found

Basically, the error message says that Lucene did not find the proper files in the index directory. I suggest checking the following:

  1. Verify the path of the index directory fits what you think it should be.
  2. Do the Nutch and Lucene versions used match? This may stem from a version difference.
  3. Is there a permissions issue? Can you read the files in the directory?
  4. Try looking at the index using Luke. If you cannot, there is probably some corruption in the index.

If all these do not help, Please post the indexing part of the code.


Another hint, as I was having the same error and found that after creating indexes I did not close IndexWriter and it proved very unforgiven. In my indexdirectory I have some .lock files and no segments or segments.gen files which is what Reader is looking for. See here #3 for details


Stumbled upon this issue in 2020:

I had opened the IndexReader using the

org.apache.lucene.index.DirectoryReader#open(org.apache.lucene.store.Directory)

method instead of

org.apache.lucene.index.DirectoryReader#open(org.apache.lucene.index.IndexWriter)

The first one resulted in the error described above, while the latter one worked fine on an empty directory - and seems the way to go here.

Tags:

Java

Lucene

Nutch