【问题标题】:Error in task sunspot:mongo:reindex in Sunspot Solr with MongoidSunspot Solr 中的任务 sunspot:mongo:reindex 中的错误与 Mongoid
【发布时间】:2011-12-01 17:25:42
【问题描述】:

我有 sunspot_mongo gem 的 solr。当我尝试运行 sunspot:mongo:reindex 时出现此错误:

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/>"

我已经停止并使用 rake sunspot:solr:stop 启动 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 ...

我已经使用命令 rake sunspot:solr:start 启动了 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 ...

已编辑

谢谢你,但不工作。我已删除索引文件夹并重新运行 sunspot:solr:start,当我尝试创建新寄存器或运行 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>"

总是这样显示:

c43d1f7f8a62a2ff6fed0bddcce1a574-write.lock

但是,当我在我的模型中对此进行评论时:

  #searchable do
    #text :content
  #end

rake 任务工作正常,不显示错误,但不索引模型。

有什么想法吗??

【问题讨论】:

  • Solr 在 index 文件夹中查找段文件(如果存在)。删除 index 文件夹,Solr start 应该使用段文件重新创建 index 文件夹。

标签: solr ruby-on-rails-3.1 sunspot sunspot-rails


【解决方案1】:

您的索引已损坏。停止 Solr,删除 solr/data/development/index 文件夹,然后重新运行 sunspot:solr:start 以重新创建它。

【讨论】:

  • 不错的一个!我们停电了,它似乎损坏了索引,为此挣扎了 3 个小时。
【解决方案2】:

@hyperrjas

除了删除 Nick 提到的 index 文件夹外,还需要杀死已经启动的 solr 进程,运行ps aux | grep 'solr' 找到。它现在应该可以工作了。

【讨论】:

  • 已经禁止了我一段时间了!发送!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-01-25
  • 2012-04-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多