Tag: sunspot solr

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

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

Rails sunspot-solr – 带连字符的单词

我正在使用sunspot_rails gem,到目前为止一切都很完美但是:我没有得到任何带连字符的搜索结果。 示例:字符串“tron”返回大量结果(所有文章中提到的单词都是e-tron) 字符串“e-tron”返回0结果,即使这是我所有文章中提到的正确单词。 我当前的schema.xml配置: 我想要的:搜索字符串tron的行为当然没问题,但我也想要搜索字符串e-tron的正确匹配。

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活动记录’LIKE’搜索

嗨我一直在我的应用程序中使用正常的rails活动记录LIKE搜索,我开始使用太阳黑子solr搜索。 我希望它尽可能接近轨道LIKE搜索。 wine.rb #sunspot stuff searchable :auto_index => true, :auto_remove => true do text :name end #sunspot stuff 的solr / CONF / schema.xml中 application_controller.rb search_string = “will input some values here” query = “%” + search_string + “%” solr_search = Wine.search do fulltext search_string end @solr_search_results = solr_search.results.sort_by{|e| e[:id]} @rails_search_results = Wine.find(:all, :conditions => [‘wines.name […]