2011-12-01 35 views
1

我用sunspot_mongo創建了solr寶石。當我嘗試運行黑子:蒙戈:重新索引我得到這個錯誤:任務太陽黑子中的錯誤:mongo:在Sunspot Solr中與Mongoid重新索引

reindexing House 
rake aborted! 
RSolr::Error::Http - 500 Internal Server Error 
Error: java.io.FileNotFoundException: no segments* file found in [email protected]/home/ubuntu/Desktop/PROJECT/solr/data/development/index: files: 

java.lang.RuntimeException: java.io.FileNotFoundException: no segments* file found in [email protected]/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/>" 

我已經停止,並與耙太陽黑子Solr的開始:Solr的:停止和我得到:

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 ... 

我有開始的Solr命令耙太陽黑子:Solr的:開始我也得到:

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

謝謝你,但不工作。我已經刪除索引文件夾,我已經重新運行黑子:Solr的:開始,當我嘗試創建一個新的寄存器或運行黑子:Solr的:開始

reindexing House 
rake aborted! 
RSolr::Error::Http - 500 Internal Server Error 
Error: no segments* file found in [email protected]/home/ubuntu/Desktop/PROJECT/solr/data/development/index: files: lucene-c43d1f7f8a62a2ff6fed0bddcce1a574-write.lock 

java.io.FileNotFoundException: no segments* file found in [email protected]/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>" 

總是出現這樣的:

c43d1f7f8a62a2ff6fed0bddcce1a574 -write.lock

然而,當我評論這個在我的模型:

#searchable do 
    #text :content 
    #end 

耙子任務工作正常,不顯示錯誤,但不索引模型。

任何想法??

+1

Solr查找索引文件夾中的段文件(如果存在)。刪除索引文件夾,並且Solr開始應該用段文件重新創建索引文件夾。 – Jayendra

回答

10

您的索引已損壞。停止Solr,刪除solr/data/development/index文件夾,然後重新運行sunspot:solr:start重新創建它。

+0

不工作:(我編輯我的帖子的結果! – hyperrjas

+0

不錯的一個!我們有一個停電,它似乎已經損壞了索引,掙扎着這個3小時。 – Francois

5

@hyperrjas

除了刪除由尼克提到的索引文件夾,你需要殺死已啓動Solr的過程中,通過運行ps aux | grep 'solr'找到。它現在應該工作。

+0

已經禁止我的頭在這一些時間!tx! – Francois