Every repository with this icon (
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Wed Jul 29 12:39:09 -0700 2009 | |
| |
CHANGE_LOG | Thu May 21 15:53:28 -0700 2009 | |
| |
LICENSE | Sat May 03 15:39:08 -0700 2008 | |
| |
README.markdown | Wed May 20 11:20:31 -0700 2009 | |
| |
README.rdoc | Wed May 20 11:20:31 -0700 2009 | |
| |
Rakefile | Tue Oct 27 15:00:03 -0700 2009 | |
| |
TESTING_THE_PLUGIN | Tue Nov 18 06:53:03 -0800 2008 | |
| |
VERSION | Tue Oct 27 17:45:51 -0700 2009 | |
| |
config/ | Wed Nov 04 14:56:19 -0800 2009 | |
| |
init.rb | Sat May 03 15:39:08 -0700 2008 | |
| |
install.rb | Sat May 03 15:39:08 -0700 2008 | |
| |
lib/ | Tue Aug 11 10:39:13 -0700 2009 | |
| |
muck-solr.gemspec | Tue Oct 27 17:49:56 -0700 2009 | |
| |
solr/ | Thu Jul 30 07:32:31 -0700 2009 | |
| |
solr_test_rakefile.rb | Wed May 20 11:31:31 -0700 2009 | |
| |
test/ | Tue May 26 12:42:11 -0700 2009 |
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.
Here is an example solr.yml configuration:
# Config file for the acts_as_solr plugin.
#
# If you change the host or port number here, make sure you update
# them in your Solr config file
development:
url: http://127.0.0.1:8982/solr
production:
url: http://127.0.0.1:8983/solr
jvm_options: -server -d64 -Xmx1024M -Xms64M
test:
url: http://127.0.0.1:8981/solr
Requirements
- Java Runtime Environment(JRE) 1.5 aka 5.0 [www.java.com/en/download/index.jsp](http://www.java.com/en/download/index.jsp)
- If you have libxml-ruby installed, make sure it’s at least version 0.7
Configuration
If you are using acts_as_solr as a Rails plugin, 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.
If you are using acts_as_solr as a gem, create a file named lib/tasks/acts_as_solr.rake:
require "acts_as_solr/tasks"
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.







