[Solved]: org.apache.lucene.index.IndexNotFoundException: no segments* file found in org.apache.lucene.store.NIOFSDirectory

Problem:

Exception in thread "main" org.apache.lucene.index.IndexNotFoundException: no segments* file found in org.apache.lucene.store.NIOFSDirectory@/Users/admin/Downloads/DBpedia_spotlight/en lockFactory=org.apache.lucene.store.NativeFSLockFactory@3dfc5fb8: files: [.DS_Store, spotter_thresholds.txt, fsa_dict.mem, stopwords.list, model.properties] at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:667) at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:72) at org.apache.lucene.index.IndexReader.open(IndexReader.java:256) at org.dbpedia.lookup.lucene.Searcher.(Searcher.scala:21) at org.dbpedia.lookup.server.Server$.main(Server.scala:51) at org.dbpedia.lookup.server.Server.main(Server.scala)

Solution:

Exception IndexNotFoundException signals that no index was found in the Directory. Possibly because the directory is empty, however can also indicate an index corruption.

So you should:

  1. Delete the index directory or restore data from backups.
  2. Restart the server (or at least the reload the config).