small medium large xlarge

Generic-user-small
11 Apr 2009, 01:26
Thanh Doan (2 posts)

Hello Mike and Erik,

Am following Recipe 27 to see if I can drill down the search results using facets. First every works fine. I ran import_books.rb script successfully and was able to get a solr connection on my irb session. The below statements worked fine too.

solr = Solr::Connection.new('http://127.0.0.1:8983/solr') response = solr.query('pragmatic', :facets => {:fields => ['pubisher_facet'], :mincount =>1}) docs = response.hits

But when I ran ` response.facet_fields(‘publisher_facet’) `

I got the below error

irb(main):013:0> response.field_facets('publisher_facet') NoMethodError: undefined method size’ for nil:NilClass from C:/Ruby/lib/ruby/gems/1.8/gems/solr-ruby-0.0.7/lib/solr/util.rb:17:in paired_array_each' from C:/Ruby/lib/ruby/gems/1.8/gems/solr-ruby-0.0.7/lib/solr/response/standard.rb:43:in field_facets’ from (irb):13 `

I am using solr 1.3, Ruby 1.8.6 on Windows Vista, solr-ruby 0.0.7. Please advise if the recipe can sill be used with out changes on solr 1.3 and solr-ruby 0.0.7?

Thank you.

Below are my installed gems on my pc.

C:\Users\thanh>ruby -v ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] C:\Users\thanh>gem -v 1.3.1 C:\Users\thanh>gem list actionmailer (2.3.2) actionpack (2.3.2) activerecord (2.3.2) activeresource (2.3.2) activesupport (2.3.2) capistrano (2.5.5) cgi_multipart_eof_fix (2.5.0) fxri (0.3.6) fxruby (1.6.16) gem_plugin (0.2.3) highline (1.5.0) hpricot (0.6.164) log4r (1.0.5) mongrel (1.1.5) mongrel_cluster (1.0.5) net-scp (1.0.2) net-sftp (2.0.2) net-ssh (2.0.11) net-ssh-gateway (1.0.1) ptools (1.1.6) rails (2.3.2) rake (0.8.4, 0.8.1) ruby-opengl (0.60.0) solr-ruby (0.0.7) test-unit (2.0.1) win32-api (1.2.1, 1.2.0) win32-clipboard (0.4.4) win32-dir (0.3.2) win32-eventlog (0.5.0) win32-file (0.5.5) win32-file-stat (1.3.1) win32-process (0.5.9) win32-sapi (0.1.4) win32-sound (0.4.1) windows-api (0.2.4) windows-pr (0.9.3)

You must be logged in to comment