如何将最新版本的 Sunspot gem 与 Solr Cell 一起使用?

发布于 2024-12-28 02:33:24 字数 1332 浏览 1 评论 0原文

我一直在尝试(徒劳地)获取与 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

メ斷腸人バ 2025-01-04 02:33:24

经过一番尝试和错误后,这个问题的答案比我希望的要容易。宝石的指定顺序显然是错误的。我没有意识到这有什么不同。我改变了顺序,让 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'

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).

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'
秋千易 2025-01-04 02:33:24

很高兴知道你已经修好了。
这是我当前的设置。我知道,宝石是一大堆乱七八糟的东西 =)

gem 'rsolr', :git => 'git://github.com/mwmitchell/rsolr', :branch => "38b5b69a0d63cdf85560806c06f3187ea4339f5a" # 1.0.6 plus the timeout patch
gem 'sunspot'
gem 'sunspot_solr'
gem 'sunspot_rails'
gem 'sunspot_index_queue'
gem 'sunspot_cell', :git => 'git://github.com/zheileman/sunspot_cell.git', :branch => "bc8ac18de1410b3e29af89c4d028acc6deba1e1c"

Glad to know you already fixed it.
This is my current setup. A pretty big mess of gems, I know =)

gem 'rsolr', :git => 'git://github.com/mwmitchell/rsolr', :branch => "38b5b69a0d63cdf85560806c06f3187ea4339f5a" # 1.0.6 plus the timeout patch
gem 'sunspot'
gem 'sunspot_solr'
gem 'sunspot_rails'
gem 'sunspot_index_queue'
gem 'sunspot_cell', :git => 'git://github.com/zheileman/sunspot_cell.git', :branch => "bc8ac18de1410b3e29af89c4d028acc6deba1e1c"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文