Skip to content

Instantly share code, notes, and snippets.

@mwmitchell
Created May 12, 2011 01:55
Show Gist options
  • Select an option

  • Save mwmitchell/967793 to your computer and use it in GitHub Desktop.

Select an option

Save mwmitchell/967793 to your computer and use it in GitHub Desktop.
force POST for all requests, and silence all errors
solr = RSolr.connect(:timeout => 60, :url => "http://localhost:8983/solr")
module RSolr4Duncan
def build_request path, opts
super path, opts.merge(:method => :post)
end
def send_and_receive path, opts
super rescue {}
end
end
solr.extend RSolr4Duncan
r = solr.get "select", :params => {:q => "AND OR"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment