Skip to content

This plugin adds full text search capabilities and many other nifty features from Apache‘s Solr to any Rails model. This fork is to track the version of acts_as_solr that we are using for our application(s).

License

Notifications You must be signed in to change notification settings

sheuer/acts_as_solr

 
 

Repository files navigation

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

The current stable release is v0.9 and was released on 06-18-2007.

Changes

Please refer to the CHANGE_LOG

Installation

Requirements

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: Current developer (tjackiw at gmail dot com)

Release Information

Released under the MIT license.

More info

http://acts-as-solr.railsfreaks.com

About

This plugin adds full text search capabilities and many other nifty features from Apache‘s Solr to any Rails model. This fork is to track the version of acts_as_solr that we are using for our application(s).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%