Вопрос

У меня есть 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/>"

Я остановился и запустил Solr с Rake Sunspot: Solr: Stop, и я получаю:

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 с Command Rake Sunspot: Solr: Start и я получаю:

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

Задача граблей работает нормально и не показывает ошибку, но не индексирует модель.

Есть идеи??

Это было полезно?

Решение

Ваш индекс поврежден. Остановите Solr, удалите solr/data/development/index папка и повторный разряд sunspot:solr:start воссоздать это.

Другие советы

@hyperrjas

Помимо удаления индексной папки, упомянутой Ником, вам нужно убить уже начальный процесс Solr, запустив ps aux | grep 'solr' найти. Это должно работать сейчас.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top