Issues with solr.paginate

102 views
Skip to first unread message

moritz

unread,
Feb 1, 2011, 1:25:50 PM2/1/11
to rsolr
I'm trying to use paginate call with the rsolr prerelease gem (gem
install rsolr -pre):

solr.paginate 1, 10, 'select', :params => {:q => '*:*'}

throws an exception

{:uri=>#<URI::HTTP:0x2eceb0c URL:http://localhost:8983/solr/select?
wt=ruby&start=0&rows=10>, :query=>"wt=ruby&start=0&rows=10", :path=>"select", :per_page=>10, :method=>:get, :page=>1, :params=>{:wt=>:ruby, :start=>0, :rows=>10}}
RSolr::Error::Http: RSolr::Error::Http - 500 Internal Server Error
Error: null

java.lang.NullPointerException
at java.io.StringReader.<init>(StringReader.java:33)
at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:
197)
at
org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:
78)
at org.apache.solr.search.QParser.getQuery(QParser.java:131)
at
org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:
89)
at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:
174)
at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:
131)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316)

Query: select?wt=ruby&start=0&rows=10

Backtrace: /Library/Ruby/Gems/1.8/gems/rsolr-1.0.0.beta5/lib/rsolr/
client.rb:207:in `adapt_response'
/Library/Ruby/Gems/1.8/gems/rsolr-1.0.0.beta5/lib/rsolr/client.rb:
150:in `execute'
/Library/Ruby/Gems/1.8/gems/rsolr-1.0.0.beta5/lib/rsolr/pagination.rb:
22:in `paginate'
(irb):16:in `irb_binding'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/irb/workspace.rb:52:in `irb_binding'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/irb/workspace.rb:52
from /Library/Ruby/Gems/1.8/gems/rsolr-1.0.0.beta5/lib/rsolr/
client.rb:207:in `adapt_response'
from /Library/Ruby/Gems/1.8/gems/rsolr-1.0.0.beta5/lib/rsolr/
client.rb:150:in `execute'
from /Library/Ruby/Gems/1.8/gems/rsolr-1.0.0.beta5/lib/rsolr/
pagination.rb:22:in `paginate'
from (irb):16

It appears that the query parameter is missing.

solr.get 'select', :params => {:q=>'*:*',:start=>0,:rows=>10} works
fine.

What can I do to make this work?

matt mitchell

unread,
Feb 1, 2011, 2:06:48 PM2/1/11
to rsolr
Hi Moritz,

This bug should be gone in 1.0.0. Try updating your rsolr gem and let
me know what happens.

Matt

moritz

unread,
Feb 1, 2011, 2:42:51 PM2/1/11
to rsolr
Switching to 1.0.0 fixed it.

Following the instructions on github, I didn't even realize that the
rsolr 1.0.0 was available. The installation instructions should
probably be updated to

sudo gem install rsolr

Thanks for your quick response.
Reply all
Reply to author
Forward
0 new messages