任务 sunspot:mongo:reindex 在 Sunspot Solr 中使用 Mongoid 时出错

发布于 2024-12-19 07:34:42 字数 3663 浏览 3 评论 0原文

我有 solr 和 sunspot_mongo gem。当我尝试运行 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 任务工作正常,不显示错误,但不索引 模型。

有什么想法吗?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

瞄了个咪的 2024-12-26 07:34:42

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

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

兔姬 2024-12-26 07:34:42

@hyperrjas

除了删除 Nick 提到的索引文件夹之外,您还需要通过运行 ps aux | 来终止已经启动的 solr 进程。 grep 'solr' 来查找。现在应该可以了。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文