public
Description: Solr-powered search for Ruby objects
Home | Edit | New

Installation and configuration

Installation

Sunspot is most easily installed using RubyGems:


$ sudo gem install outoftime-sunspot --source=http://gems.github.com

If you use an alternate system of package management, you can pull Sunspot from git://github.com/outoftime/sunspot.git.

Starting up Solr

Sunspot comes with a prepackaged instance of Solr, which makes it easy to get started in development mode. To start Sunspot’s Solr instance, run:


$ sunspot-solr start

This will store the index data in your operating system’s temporary directory – see Configuring Solr for use with Sunspot in development and production? for more options available when when running the packaged Solr instance.

Configuration

Sunspot is configured using the Sunspot.config object. The following options are available:

Sunspot.config.http_client
Which HTTP library to use to connect to Solr. The default is :net_http, which indicates the use of the standard library’s Net::HTTP library. The other option is :curb, which uses Ruby LibCURL bindings, and is much faster.
Sunspot.config.solr.url
The URL at which to connect to Solr. The default is http://127.0.0.1:8983/solr
Sunspot.config.pagination.default_per_page
The number of results to return per page if not specified in the search. The default is 30.
Last edited by outoftime, Wed Jul 22 05:02:50 -0700 2009
Home | Edit | New
Versions: