-1
  • I had a problem about RSolr::Ext.
  • When i try to query with params page and per_page use library rsolr-ext in order to connect to Apache Solr.

And i get an error same as:

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'

This is my code:

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

Hope that everybody can support me. Thank you very much.

Khanh Pham
  • 2,848
  • 2
  • 28
  • 36

1 Answers1

0

I guess the issue is with :field_names key, which seems to be unsupported by RSolr::Ext#find method. Did you mistaken with :queries, :phrases or other available ?

joanbm
  • 793
  • 1
  • 6
  • 13