【发布时间】: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