RSolr examples in the github readme.

168 views
Skip to first unread message

Nick Martin

unread,
Dec 9, 2010, 4:24:42 PM12/9/10
to rsolr
Hi Matt, All,

I was trying a couple of solr.get examples in the readme on github for
rsolr:

# send a request to /select
response = solr.get 'select', :params => {:q => '*:*'}

But this raises:
ruby-1.9.2-p0 > response = solr.get 'select', :params => {:q => '*:*'}
TypeError: can't convert String into Hash
from /home/nick/.rvm/gems/ruby-1.9.2-p0/gems/rsolr-0.12.1/lib/
rsolr/client.rb:90:in `merge'
from /home/nick/.rvm/gems/ruby-1.9.2-p0/gems/rsolr-0.12.1/lib/
rsolr/client.rb:90:in `map_params'
from /home/nick/.rvm/gems/ruby-1.9.2-p0/gems/rsolr-0.12.1/lib/
rsolr/client.rb:34:in `request'
from /home/nick/.rvm/gems/ruby-1.9.2-p0/gems/rsolr-0.12.1/lib/
rsolr/client.rb:16:in `method_missing'
from (irb):65
from /home/nick/.rvm/rubies/ruby-1.9.2-p0/bin/irb:16:in
`<main>'

Doing:
response = solr.select({:q=>'*:*'})

Works fine.

Just wondered if you could clarify why the error was happening. I'm
new to Ruby so perhaps it's something obvious to one of you.

Many thanks

Nick

matt mitchell

unread,
Dec 9, 2010, 4:32:00 PM12/9/10
to rsolr
Yes, kinda confusing :)

The master branch contains the 1.0/beta code. Looks like you're using
0.12.1, which has a tag and you can find the docs here:
https://github.com/mwmitchell/rsolr/tree/v0.12.1

If you'd like to use beta: http://rubygems.org/gems/rsolr/versions/1.0.0.beta5
and then the docs on the main/master github page make more sense.

Matt

Nick Martin

unread,
Dec 9, 2010, 5:26:48 PM12/9/10
to rs...@googlegroups.com
Thanks for the explanation Matt. Much appreciated.

Nick

> --
> You received this message because you are subscribed to the Google Groups "rsolr" group.
> To post to this group, send email to rs...@googlegroups.com.
> To unsubscribe from this group, send email to rsolr+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rsolr?hl=en.
>

Reply all
Reply to author
Forward
0 new messages