如何将最新版本的 Sunspot gem 与 Solr Cell 一起使用?
我一直在尝试(徒劳地)获取与 Solr Cell 一起使用的最新版本的 Sunspot gem(当前为 2.0.0.pre.111215,包含 Solr 3.5)。
目前,我正在将旧版本的 Sunspot 与以下插件提供的 Solr Cell 结合使用 - https://github.com/chebyte/sunspot_cell< /a>.
我的 Gemfile 此配置如下;
gem 'sunspot', '1.2.1'
gem 'sunspot_rails'
不幸的是,这种较旧的 Solr/Solr 单元组合不适用于许多较新的 PDF 文件。 Apache 推荐的解决方案是将两者都升级到最新版本。
Sunspot Solr Cell 附加组件似乎没有得到很好的支持。最近更新的版本已从插件切换为 Gem,但我仍然无法使其与最新版本的 Sunspot Gem 一起使用。 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 中捆绑的文件,但也没有成功。
I've been trying (in vain) to get the latest version of the Sunspot gem (currently 2.0.0.pre.111215, incorporating Solr 3.5) working with Solr Cell.
Currently I am using the older version of Sunspot in combination with Solr Cell provided by the following plugin - https://github.com/chebyte/sunspot_cell.
My Gemfile for this configuration is as follows;
gem 'sunspot', '1.2.1'
gem 'sunspot_rails'
Unfortunately this older combination of Solr/Solr cell does not work with many newer PDF files. The recommended solution by Apache is to upgrade to the latest version of both.
The Sunspot Solr Cell bolt-on doesn't seem to be very well supported. The most recently updated version has been switched from a Plugin to a Gem, but I still can't get it to work with the latest version of the Sunspot Gem. https://github.com/zheileman/sunspot_cell
Does anyone know the correct Gemfile configuration to get the elements to play nicely together? The closest I have is this.
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
When I run any rake task I get the following error.
uninitialized constant Sunspot::RSolr
If I comment the sunspot_cell gem out temporarily, I can get Rake tasks to run but actual searching fails.
I've tried manually using the Solr jar files in this gem instead of the ones bundled in sunspot_solr but also without success.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
经过一番尝试和错误后,这个问题的答案比我希望的要容易。宝石的指定顺序显然是错误的。我没有意识到这有什么不同。我改变了顺序,让 sunspot_cell 排在最后,然后它就突然变成了这样。魔法! (几乎)。
After a bit of trial and error, the answer to this turned out to be easier than I had hoped. The gems were apparently specified in the wrong order. I didn't realise it made any difference. I changed the order so that sunspot_cell was last and it burst into like. Magic! (almost).
很高兴知道你已经修好了。
这是我当前的设置。我知道,宝石是一大堆乱七八糟的东西 =)
Glad to know you already fixed it.
This is my current setup. A pretty big mess of gems, I know =)