【问题标题】:Solr sunspot pdf indexingSolr 太阳黑子 pdf 索引
【发布时间】:2015-04-24 11:12:46
【问题描述】:

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

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

【问题讨论】:

    标签: ruby-on-rails pdf solr


    【解决方案1】:

    好吧,我知道这是个老问题,但对于像我这样来自谷歌搜索的人来说,这可能有助于节省几个小时 -

    有问题的链接到blog - 相当不错的食谱风格文章,但是使用那里的 gem 已经过时并且与当前版本的太阳黑子 gem 不兼容。

    检查请更新 gem sunspot_cell。它与 Sunspot gem >= 2.2.5 兼容。实际上,它是 sunspot_cell gem 死版的更新镜像。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-29
      • 1970-01-01
      • 2013-03-16
      • 1970-01-01
      • 2014-05-30
      • 1970-01-01
      相关资源
      最近更新 更多