rsolr-ext url without select

44 views
Skip to first unread message

bryan

unread,
Sep 27, 2011, 3:57:07 AM9/27/11
to rsolr
Hi,

I am trying to use rsolr.ext to connect to a url that does not have
select at the end of the url.

so that the code

solr = RSolr::Ext.connect :url => 'http://localhost:8090/solr/document/
snippets/'
solr_params = {
:page=>page,
:per_page=>25,
:elementquery=>elementquery,
:queries=>params[:frt]
}
@search_result = solr.find solr_params
@search_numFound = @search_result.response["numFound"]
@search_start = @search_result.response["start"]

ends up returning the error
RSolr::Error::Http - 404 Not Found
...errror message from apache tomcat....
URI: http://localhost:8090/solr/document/snippets/select?..rest of
querystring.

There is otherwise no problem with the code in that I can use it with
services that have a select at the end of the path....
In Solr I suppose I could use solr.get to maneuver around this
problem? But how do I do it in solr.ext, since I'm something of a ruby
newbie I don't relish trying to hack solr.ext itself to do it.





bryan rasmussen

unread,
Sep 27, 2011, 5:09:35 AM9/27/11
to rsolr
Hi,

Ok looking at the rsolr-ext code I realized I just had to do "",
solr_params after find.

Thanks,
Bryan Rasmussen

matt mitchell

unread,
Sep 28, 2011, 9:05:58 PM9/28/11
to rs...@googlegroups.com
Exactly! It defaults to the "select" handler but the first arg can override the handler path:

https://github.com/mwmitchell/rsolr-ext/blob/master/lib/rsolr-ext/client.rb#L14

Matt
Reply all
Reply to author
Forward
0 new messages