Tag: sunspot

太阳黑子 – 提升文本中早期匹配发生的记录

例如,假设我的数据库中有一条记录有”Hormel Corporation” ,我的搜索字词就像”Hormel Corned Beef 16 Ounces” 。 正如我目前的配置一样,最好的结果将是其他记录,即使”Hormel Corporation”是我正在寻找的。 我认为我的问题的解决方案是优先考虑匹配在搜索词中最早的记录。 我已经阅读了所有的文档,但我无法弄清楚这是如何工作的。 我只有一个字段 – 名字。 我想要的记录的名称字段是“Hormel公司”,但是当我搜索“Hormel Corned Beef 16 Ounces”时,最好的结果是ISNT“Hormel公司”,但看似随机的东西,而记录我是寻找结果中的第3或第4位。 非常感谢!

Solr,Sunspot,SQlite和Rails

我想为使用SQlite3作为数据库的项目实现全文搜索+分面。 我听说Solr非常强大。 有Sunspot和Solr教程可用,但仅适用于MySQL。 我找不到任何关于如何为SQLite3设置它的文档。 有人知道如何使用SQLite3进行设置吗? 或者这不可能吗?

Solr / Lucene是否可以先按相关性排序,然后按第二个属性排序?

在Solr / Lucene中,可以首先按相关性排序,然后按第二个属性排序吗? 据我所知,如果我设置了一个排序参数,它会完全覆盖相关性,并按排序参数进行排序。 如何将结果首先按相关性排序,然后在两个条目具有完全相同的相关性的情况下,给出项目的点头,例如,按字母顺序排在第一位。 如果它有所不同我在Ruby on Rails中使用Solr通过Sunspot。

rake sunspot:solr:reindex不能在带有多个引擎的Rails 4 app中工作

我有多个引擎的rails 4 beta1应用程序。 我在我的主机应用程序中安装了sunspot_rails gem /2.0.0.pre.130115/。 我的大多数模特都住在engine1。 我在其他引擎上使用它们。 安装sunspot_rails后,使用rake sunspot:solr:run sunspot rake sunspot:solr:run我command/task not found 。 根据文档,我找到了解决方案。 这是链接: https : //github.com/sunspot/sunspot/wiki/Adding-Sunspot-search-to-Rails-in-5-minutes-or-less 在我创建新记录后,Solr在搜索中找到了它。 但是当我重新编制数据索引时,仍然没有通过搜索找到旧记录。 在我看来,reindex没有奏效。 我已经尝试停止并重新启动solr服务器,重启我的电脑几次但没有运气。 任何的想法? 如果您需要更多信息,请告诉我。 这是我的gem: Gems included by the bundle: * actionmailer (4.0.0.beta1) * actionpack (4.0.0.beta1) * activemodel (4.0.0.beta1) * activerecord (4.0.0.beta1) * activerecord-deprecated_finders (0.0.3) * activesupport (4.0.0.beta1) * admin (0.0.1) * […]

Rails 4:RSolr :: Error :: Http(RSolr :: Error :: Http – 404 Not Found

我正在将我的应用程序升级到Rails 4,现在得到了我的rails服务器,以及太阳黑子solr,经过大量的修补,运行后,我可以访问Solr管理页面。 但是,当我尝试从我的rails开发应用程序访问solr进行搜索或索引时,我收到以下错误 RSolr::Error::Http (RSolr::Error::Http – 404 Not Found Error: Not Found Request Data: “fq=type%3AMatch&fq=date_in_utc_d%3A%7B2013%5C-11%5C-29T21%5C%3A00%5C%3A00Z+TO+%2A%7D&fq=approval__s%3AAPPROVED&sort=date_d+asc&q=london&fl=%2A+score&qf=caption_text%5E10+city_name_text%5E10+team_name_text%5E10+&defType=edismax&start=0&rows=30” Backtrace: /Users/bashar/.rvm/gems/ruby-2.0.0-p353/gems/rsolr-1.0.9/lib/rsolr/client.rb:268:in `adapt_response’ /Users/bashar/.rvm/gems/ruby-2.0.0-p353/gems/rsolr-1.0.9/lib/rsolr/client.rb:175:in `execute’ /Users/bashar/.rvm/gems/ruby-2.0.0-p353/gems/rsolr-1.0.9/lib/rsolr/client.rb:161:in `send_and_receive’ /Users/bashar/.rvm/gems/ruby-2.0.0-p353/gems/sunspot_rails-2.1.0/lib/sunspot/rails/solr_instrumentation.rb:16:in `block in send_and_receive_with_as_instrumentation’ /Users/bashar/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.1/lib/active_support/notifications.rb:159:in `block in instrument’ /Users/bashar/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument’ /Users/bashar/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.1/lib/active_support/notifications.rb:159:in `instrument’ /Users/bashar/.rvm/gems/ruby-2.0.0-p353/gems/sunspot_rails-2.1.0/lib/sunspot/rails/solr_instrumentation.rb:15:in `send_and_receive_with_as_instrumentation’ (eval):2:in `post’ /Users/bashar/.rvm/gems/ruby-2.0.0-p353/gems/sunspot-2.1.0/lib/sunspot/search/abstract_search.rb:45:in `execute’ /Users/bashar/.rvm/gems/ruby-2.0.0-p353/gems/sunspot-2.1.0/lib/sunspot/session.rb:59:in `search’): app/models/match.rb:474:in `upcoming_games’ app/controllers/tickets_controller.rb:34:in `search’ Rendered /Users/bashar/.rvm/gems/ruby-2.0.0-p353/gems/actionpack-4.0.1/lib/action_dispatch/middleware/templates/rescues/_source.erb (0.4ms) Rendered /Users/bashar/.rvm/gems/ruby-2.0.0-p353/gems/actionpack-4.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.8ms) Rendered /Users/bashar/.rvm/gems/ruby-2.0.0-p353/gems/actionpack-4.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.8ms) […]

在Sunspot上调试Solr搜索查询

在Rails上使用Sunspot gem时,如何调试Solr搜索查询? 我有一些问题正在回归奇怪的高分,我正试图找到为什么会发生这种情况。 似乎没有任何调试信息暴露给Sunspot,所以我认为我需要直接通过Solr进行调试。 幸运的是,Solr有一个方便的Web界面可供搜索,但出于某种原因,我输入的任何查询返回0结果。 例如,当我在我的网络应用程序上搜索单词“test”时,它会返回大量的点击。 当我在Solr管理界面上搜索相同的东西时,这就是我得到的: 0 172 *,score on 0 test standard standard 2.2 10

耙太阳黑子:reindex耙子流产! RSolr :: Error :: Http – 404 Not Found

我再也无法重新索引,无法解决此问题。 花几个小时挖掘网络来解决这个问题。 ** *关于生产环境*开发顺利。 :(如何解决这个问题? rake sunspot:reindex rake aborted! RSolr::Error::Http – 404 Not Found Error: Not Found Request Data: “type:Match” Backtrace: /srv/books/shared/bundle/ruby/2.0.0/gems/rsolr-1.0.9/lib/rsolr/client.rb:268:in `adapt_response’ /srv/books/shared/bundle/ruby/2.0.0/gems/rsolr-1.0.9/lib/rsolr/client.rb:175:in `execute’ /srv/books/shared/bundle/ruby/2.0.0/gems/rsolr-1.0.9/lib/rsolr/client.rb:161:in `send_and_receive’ /srv/books/shared/bundle/ruby/2.0.0/bundler/gems/sunspot-4e6c7870e3aa/sunspot_rails/lib/sunspot/rails/solr_instrumentation.rb:16:in `block in send_and_receive_with_as_instrumentation’ /srv/books/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/notifications.rb:159:in `block in instrument’ /srv/books/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument’ /srv/books/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/notifications.rb:159:in `instrument’ /srv/books/shared/bundle/ruby/2.0.0/bundler/gems/sunspot-4e6c7870e3aa/sunspot_rails/lib/sunspot/rails/solr_instrumentation.rb:15:in `send_and_receive_with_as_instrumentation’ (eval):2:in `post’ /srv/books/shared/bundle/ruby/2.0.0/gems/rsolr-1.0.9/lib/rsolr/client.rb:67:in `update’ /srv/books/shared/bundle/ruby/2.0.0/gems/rsolr-1.0.9/lib/rsolr/client.rb:131:in `delete_by_query’/srv/books/shared/bundle/ruby/2.0.0/gems/rsolr-1.0.9/lib/rsolr/client.rb:268:in `adapt_response’ /srv/books/shared/bundle/ruby/2.0.0/gems/rsolr-1.0.9/lib/rsolr/client.rb:175:in `execute’ /srv/books/shared/bundle/ruby/2.0.0/gems/rsolr-1.0.9/lib/rsolr/client.rb:161:in `send_and_receive’ /srv/books/shared/bundle/ruby/2.0.0/bundler/gems/sunspot-4e6c7870e3aa/sunspot_rails/lib/sunspot/rails/solr_instrumentation.rb:16:in `block in […]

Sunspot如何修改Solr的schema.xml? 是否会修改它?

如果我错了,请告诉我,但我认为solr只需要schema.xml中已经提到过的字段。 所以,如果我有一个名为’title’的字段,我需要在模式中提到它。 在Sunspot的文档中没有提到修改schema.xml。 我只是想知道Sunspot如何修改schema.xml,允许自定义字段输入索引。 我也知道Sunspot使用RSolr来做事情。 因此,如果有办法修改架构并使用RSolr将数据从DB重新加载到Solr,请告诉我。

sunspot_rails保存后不重新索引模型

我有一个模型,它部署一个延迟的作业,更新它的一些属性。 该模型被宣布为“可搜索”…… searchable do text :content, :stored => true end …我认为在保存后会重新索引。 在测试中,情况似乎并非如此。 如果我运行: rake sunspot:reindex ,那么一切都按预期工作。 可能导致此问题的原因是什么?

Solr with Rails – rake sunspot:reindex无效

希望每个人都很好,做得好! 我陷入一个奇怪的问题,我正在寻找你的输入。 我的问题是: 在使用Capistrano在Production上部署我的应用程序后,当我进行solr重新索引时,它给出了以下错误: $ bundle exec rake sunspot:reindex –trace ** Invoke sunspot:reindex (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute sunspot:reindex Skipping progress bar: for progress reporting, add gem ‘progress_bar’ to your Gemfile rake aborted! RSolr::Error::Http – 404 Not Found Error: Not Found Request Data: “query>type:OccupationData” Backtrace: /data/APP_NAME/shared/bundled_gems/ruby/1.9.1/gems/rsolr-1.0.9/lib/rsolr/client.rb:268:in `adapt_response’ /data/APP_NAME/shared/bundled_gems/ruby/1.9.1/gems/rsolr-1.0.9/lib/rsolr/client.rb:175:in `execute’ /data/APP_NAME/shared/bundled_gems/ruby/1.9.1/gems/rsolr-1.0.9/lib/rsolr/client.rb:161:in […]