如何在Solr Cell中使用最新版本的Sunspot gem?

Sim*_*mmo 5 solr ruby-on-rails sunspot solr-cell

我一直在尝试(徒劳)获得与Solr Cell合作的最新版Sunspot gem(目前2.0.0.pre.111215,包含Solr 3.5).

目前我使用旧版本的Sunspot与Solr Cell结合使用以下插件 - https://github.com/chebyte/sunspot_cell.

我的Gemfile配置如下:

gem 'sunspot', '1.2.1'
gem 'sunspot_rails' 
Run Code Online (Sandbox Code Playgroud)

不幸的是,这种较旧的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
Run Code Online (Sandbox Code Playgroud)

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

uninitialized constant Sunspot::RSolr
Run Code Online (Sandbox Code Playgroud)

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

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

Sim*_*mmo 4

经过一番尝试和错误后,这个问题的答案比我希望的要容易。宝石的指定顺序显然是错误的。我没有意识到这有什么不同。我改变了顺序,让 sunspot_cell 排在最后,然后它就突然变成了这样。魔法!(几乎)。

gem 'sunspot', :git => "git://github.com/sunspot/sunspot.git"
gem 'sunspot_rails', :git => "git://github.com/sunspot/sunspot.git", :require => "sunspot_rails"
gem 'sunspot_cell', :git => 'git://github.com/zheileman/sunspot_cell.git'
Run Code Online (Sandbox Code Playgroud)