簡體   English   中英

Solr太陽黑子pdf索引

[英]Solr sunspot pdf indexing

我正在按照本教程將pdf文檔索引到solr https://cbpowell.wordpress.com/2012/09/18/indexing-rich-documents-with-rails-sunspot-solr-sunspot-cell-and-carrierwave-cookbook -樣式/
我的模型是

class Manual < ActiveRecord::Base
    mount_uploader :pdf_document, PdfUploader
    before_save :update_upload_attributes

    # Sunspot indexing configuration
  searchable do
    # Regular fields that I want indexed
    text :name

    # For Sunspot Cell. The 'attachment' directive instructs
    # Cell how to get the binary data. My understanding is that
    # this *must* end in _attachment
    attachment :pdf_document
  end
    private
        def update_upload_attributes
        if pdf_document.present? && pdf_document_changed?
          self.content_type = pdf_document.file.content_type
          self.file_size = pdf_document.file.size
          self.file_name = File.basename(pdf_document.url)
        end
      end
end

但是當我嘗試重新索引時,出現以下錯誤

Error - RSolr::Error::Http - 500 Internal Server Error - retrying...
Error - RSolr::Error::Http - 500 Internal Server Error - ignoring...
[####################################] [2/2] [100.00%] [00:00] [00:00] [54.90/s]

當我嘗試提交表單時,出現以下錯誤

RSolr::Error::Http (RSolr::Error::Http - 500 Internal Server Error
Error: {'error'=>{'msg'=>'java.lang.AbstractMethodError','trace'=>'java.lang.RuntimeException: java.lang.AbstractMethodError

好吧,我知道這是個老問題,但是對於像我這樣的Google搜索人員來說,這可能會節省幾個小時的時間-

有問題的博客鏈接-不錯的食譜風格文章,但是使用那里的寶石已過時,並且與當前版本的黑子寶石不兼容。

檢查請更新gem sunspot_cell 它與Sunspot gem> = 2.2.5兼容。 實際上,它是sunspot_cell gem失效版本的更新鏡像。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM