【问题标题】:Rsolr::Ext return undefined method `to_i' for ["10", "10"]:ArrayRsolr::Ext 为 ["10", "10"]:Array 返回未定义的方法 `to_i'
【发布时间】:2015-07-28 16:12:34
【问题描述】:
  • 我遇到了关于 RSolr::Ext 的问题。
  • 当我尝试使用参数pageper_page 进行查询时,请使用库rsolr-ext 以连接到Apache Solr。

我得到一个相同的错误:

NoMethodError: undefined method `to_i' for ["10", "10"]:Array
from /home/khanhpn/.rvm/gems/ruby-2.2.2@music/gems/rsolr-ext-1.0.3/lib/rsolr-ext/response.rb:27:in `rows'

这是我的代码:

@solr_connection = RSolr::Ext.connect(
  url: "http://localhost:8080/solr/music",
  open_timeout: 10,
  read_timeout: 10,
  retry_503: 2)

solr_params = {
     :page => 0,
     :per_page => 10,
     :field_names => [:id, :title],
     :queries => "xuan"
}

solr_connection.find(solr_params)

希望大家多多支持。非常感谢。

【问题讨论】:

    标签: ruby-on-rails ruby solr rsolr


    【解决方案1】:

    我想问题出在:field_names 键上,RSolr::Ext#find 方法似乎不支持它。您是否误认为:queries:phrases 或其他可用的?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-01-31
      • 1970-01-01
      • 2023-03-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多