加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 如何在Solr Cell中使用最新版本的Sunspot gem

发布时间:2020-12-17 03:21:22 所属栏目:百科 来源:网络整理
导读:我一直在尝试(徒劳)获得与Solr Cell合作的最新版Sunspot gem(目前2.0.0.pre.111215,包含Solr 3.5). 目前我使用旧版本的太阳黑子与Solr Cell结合使用以下插件 – https://github.com/chebyte/sunspot_cell. 我的Gemfile配置如下: gem 'sunspot','1.2.1'gem '
我一直在尝试(徒劳)获得与Solr Cell合作的最新版Sunspot gem(目前2.0.0.pre.111215,包含Solr 3.5).

目前我使用旧版本的太阳黑子与Solr Cell结合使用以下插件 – https://github.com/chebyte/sunspot_cell.

我的Gemfile配置如下:

gem 'sunspot','1.2.1'
gem 'sunspot_rails'

不幸的是,这种较旧的Solr / Solr单元组合不适用于许多较新的PDF文件. Apache推荐的解决方案是升级到两者的最新版本.

太阳黑子Solr Cell螺栓固定似乎没有得到很好的支持.最近更新的版本已从插件切换到宝石,但我仍然无法使用最新版本的太阳黑子宝石. https://github.com/zheileman/sunspot_cell

有没有人知道正确的Gemfile配置,以使元素很好地一起播放?我最接近的是这个.

gem 'sunspot_cell',:git => 'git://github.com/zheileman/sunspot_cell.git'
gem 'sunspot',:git => "git://github.com/sunspot/sunspot.git"
gem 'sunspot_rails',:git => "git://github.com/sunspot/sunspot.git",:require => "sunspot_rails"

group :development,:test do
  gem 'sunspot_solr',:git => "git://github.com/sunspot/sunspot.git"
end

当我运行任何rake任务时,我收到以下错误.

uninitialized constant Sunspot::RSolr

如果我暂时评论sunspot_cell gem,我可以运行Rake任务但实际搜索失败.

我尝试在this gem中手动使用Solr jar文件,而不是sunspot_solr中捆绑的文件,但也没有成功.

解决方法

经过一些试验和错误后,答案比我希望的更容易.宝石显然是以错误的顺序指定的.我没有意识到它有任何区别.我更改了顺序,以便sunspot_cell是最后一个,它就像爆炸一样.魔法! (几乎).

gem 'sunspot',:require => "sunspot_rails"
gem 'sunspot_cell',:git => 'git://github.com/zheileman/sunspot_cell.git'

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读