Code Monkey home page Code Monkey logo

epictetus / acts_as_solr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from roidrage/acts_as_solr

1.0 2.0 0.0 11.91 MB

WARNING: No longer actively maintained! 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.

Home Page: http://mattmatt.github.com/acts_as_solr

License: MIT License

acts_as_solr's Introduction

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

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

Support

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

Release Information

Released under the MIT license.

More info

The old acts_as_solr homepage is no more. For more up-to-date information, check out the project page of the current mainline on GitHub.

acts_as_solr's People

Contributors

dsboulder avatar kengruven avatar nickh avatar roidrage avatar tomafro avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.