cyx / acts_as_solr forked from mattmatt/acts_as_solr

This plugin adds full text search capabilities and many other nifty features from Apache‘s Solr to any Rails model. I'm currently rearranging the test suite to include a real unit test suite, and adding a few features I need myself.

This URL has Read+Write access

cyx (author)
Mon Jun 08 20:55:18 -0700 2009
commit  9e8bb98a802c6838f231fc4d9426d8a084a1f3cf
tree    62c0fad15edb14fdd9cbe99e90130980d5d494d5
parent  d13eb86236b11ab3f0adb152ff965ecb100ce4e4
name age message
file .gitignore Tue Jul 29 15:14:56 -0700 2008 Don't store test database in repository git-sv... [tomw]
file CHANGE_LOG Sat Feb 28 08:10:09 -0800 2009 Updated changelog. [mattmatt]
file LICENSE Sat May 03 15:39:08 -0700 2008 git import of acts_as_solr [Thiago Jackiw]
file README.markdown Loading commit data...
file README.rdoc Thu Apr 16 23:07:08 -0700 2009 Changed Lighthouse to GitHub issues. [mattmatt]
file Rakefile Thu Jan 22 07:57:20 -0800 2009 Changed output directory for rdoc. [mattmatt]
file TESTING_THE_PLUGIN Tue Nov 18 06:53:03 -0800 2008 Updated testing howto for the new unit test suite. [mattmatt]
directory config/ Sun Feb 08 09:29:10 -0800 2009 Changed URL from localhost to using just the IP... [mattmatt]
file init.rb Sat May 03 15:39:08 -0700 2008 git import of acts_as_solr [Thiago Jackiw]
file install.rb Sat May 03 15:39:08 -0700 2008 git import of acts_as_solr [Thiago Jackiw]
directory lib/
directory solr/ Thu Oct 02 14:53:26 -0700 2008 Updated files from Solr 1.3 [mattmatt]
directory test/ Sun Mar 22 11:35:22 -0700 2009 Minor fixes to get the tests working with Rails... [mattmatt]
README.rdoc

acts_as_solr Rails plugin

This plugin adds full text search capabilities and many other nifty features from Apache’s Solr to any Rails model. It was based on the first draft by Erik Hatcher.

Current Release

There is no numbered release yet, but the master branch is always considered stable.

Support

Check the project website or stop by the Google Group. Send bug reports through GitHub.

Changes

Please refer to the CHANGELOG

Installation

For Rails >= 2.1:

     script/plugin install git://github.com/mattmatt/acts_as_solr.git

For Rails < 2.1:

     cd vendor/plugins
     git clone git://github.com/mattmatt/acts_as_solr.git
     rm -rf acts_as_solr/.git

Make sure you copy vendor/plugins/acts_as_solr/config/solr.yml to your Rails application’s config directory, when you install via git clone.

Requirements

Configuration

Basically everything is configured to work out of the box. You can use `rake solr:start` and `rake solr:stop` to start and stop the Solr web server (an embedded Jetty). If the default JVM options aren’t suitable for your environment, you can configure them in solr.yml with the option `jvm_options`. There is a default set for the production environment to have some more memory available for the JVM than the defaults, but feel free to change them to your liking.

Basic Usage

# Just include the line below to any of your ActiveRecord models:

  acts_as_solr

# Or if you want, you can specify only the fields that should be indexed:

  acts_as_solr :fields => [:name, :author]

# Then to find instances of your model, just do:

  Model.find_by_solr(query) #query is a string representing your query

# Please see ActsAsSolr::ActsMethods for a complete info

acts_as_solr in your tests

To test code that uses acts_as_solr you must start a Solr server for the test environment. You can do that with

    rake solr:start RAILS_ENV=test

However, if you would like to mock out Solr calls so that a Solr server is not needed (and your tests will run much faster), just add this to your `test_helper.rb` or similar:

    class ActsAsSolr::Post
      def self.execute(request)
        true
      end
    end

(via)

Authors

Erik Hatcher: First draft Thiago Jackiw: Previous developer Luke Francl: Current developer Mathias Meyer: Current developer

Release Information

Released under the MIT license.