Querying

Use the #select method to send requests to the /select handler:

response = solr.select({
:q=>'washington',
:start=>0,
:rows=>10
})

The params sent into the method are sent to Solr as-is. The one exception
is if a value is an array. When an array is used, multiple parameters *with
the same name* are generated for the Solr query. Example:

solr.select :q=>'roses', :fq=>['red', 'violet']

The above statement generates this Solr query:

?q=roses&fq=red&fq=violet

Use the #request method for a custom request handler path:

response = solr.request '/documents', :q=>'test'

A shortcut for the above example use a method call instead:

response = solr.documents :q=>'test'

Updating Solr

Updating uses native Ruby structures. Hashes are used for single documents
and arrays are used for a collection of documents (hashes). These
structures get turned into simple XML “messages”. Raw XML strings can also
be used.

Response Formats

The default response format is Ruby. When the :wt param is set to :ruby,
the response is eval'd resulting in a Hash. You can get a raw response
by setting the :wt to “ruby” - notice, the string – not a symbol. RSolr
will eval the Ruby string ONLY if the :wt value is :ruby. All other
response formats are available as expected, :wt=>'xml' etc..

Evaluated Ruby (default)

solr.select(:wt=>:ruby) # notice :ruby is a Symbol

Raw Ruby

solr.select(:wt=>'ruby') # notice 'ruby' is a String

XML:

solr.select(:wt=>:xml)

JSON:

solr.select(:wt=>:json)

You can access the original request context (path, params, url etc.) by
calling the #raw method: