Question

I have solr with sunspot_mongo gem. When I try run sunspot:mongo:reindex I get this error:

reindexing House
rake aborted!
RSolr::Error::Http - 500 Internal Server Error
Error: java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.NIOFSDirectory@/home/ubuntu/Desktop/PROJECT/solr/data/development/index: files:

java.lang.RuntimeException: java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.NIOFSDirectory@/home/ubuntu/Desktop/PROJECT/solr/data/development/index: files:
at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1068)
at org.apache.solr.update.DirectUpdateHandler2.commit(DirectUpdateHandler2.java:418)
at org.apache.solr.update.processor.RunUpdateProcessor.processCommit(RunUpdateProcessorFactory.java:85)
at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:169)
at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:69)
at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:54)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316)

Request Data: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><commit/>"

I have stopped and start solr with rake sunspot:solr:stop and I get:

java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.10) (6b20-1.9.10-0ubuntu1~10.10.2)
OpenJDK Client VM (build 19.0-b09, mixed mode, sharing)
Successfully stopped Solr ...

I have started Solr with command rake sunspot:solr:start and I get:

java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.10) (6b20-1.9.10-0ubuntu1~10.10.2)
OpenJDK Client VM (build 19.0-b09, mixed mode, sharing)
Successfully started Solr ...

EDITED

thank you but not working. I have delete index folder and I have rerun sunspot:solr:start and when I try create a new register or run sunspot:solr:start

reindexing House
rake aborted!
RSolr::Error::Http - 500 Internal Server Error
Error: no segments* file found in org.apache.lucene.store.NIOFSDirectory@/home/ubuntu/Desktop/PROJECT/solr/data/development/index: files: lucene-c43d1f7f8a62a2ff6fed0bddcce1a574-write.lock

java.io.FileNotFoundException: no segments* file found in  org.apache.lucene.store.NIOFSDirectory@/home/ubuntu/Desktop/PROJECT/solr/data/development/index: files: lucene-c43d1f7f8a62a2ff6fed0bddcce1a574-write.lock
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:655)
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:538)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:306)
at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:1577)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1402)
at org.apache.solr.update.SolrIndexWriter.<init>(SolrIndexWriter.java:190)
at org.apache.solr.update.UpdateHandler.createMainIndexWriter(UpdateHandler.java:98)
at org.apache.solr.update.DirectUpdateHandler2.openWriter(DirectUpdateHandler2.java:173)

Request Data: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><add><doc><field name=\"id\">House 4ed7c2f31d41c8327e000006</field><field name=\"type\">House</field><field name=\"class_name\">House</field><field name=\"content_text\">This is a new house</field></doc></add>"

Always appear this:

c43d1f7f8a62a2ff6fed0bddcce1a574-write.lock

However when I commented this in my model:

  #searchable do
    #text :content
  #end

The rake task working fine and not show error but not index the model.

Any idea??

Was it helpful?

Solution

Your index is corrupted. Stop Solr, delete the solr/data/development/index folder, and re-run sunspot:solr:start to recreate it.

OTHER TIPS

@hyperrjas

Besides deleting the index folder mentioned by Nick, you need to kill the already-start solr process, by run ps aux | grep 'solr' to find. It should work now.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top