Powerful and built on Lucene (like Solr)
Schema free and dead simple to set up
Elegant and simple RESTful API
Simple sharding and replication
Beautiful website with excellent documentation
Nice API (like Sunspot)
Integrates with ActiveModel instead of ActiveRecord. This means it works with MongoMapper out of the box.
Put the following in your Gemfile:
gem 'bson_ext' gem 'mongo_mapper' gem 'sunspot_mongo'
rails g mongo_mapper:config rails g sunspot_rails:install rake sunspot:solr:start
gem 'bson_ext' gem 'mongoid' gem 'sunspot_mongo'
rails g mongoid:config rails g sunspot_rails:install rake sunspot:solr:start
Add the following to your model (assuming you have a string field named “content”):
include Sunspot::Mongo searchable do text :content end
Then search like usual:
search = Article.search do fulltext "something interesting" end search.results
See the Sunspot documentation.
This gem has been tested against Ruby 1.9.2 and Rails 3.1, although it should work with older versions.
Based on sunspot_mongoid by jugyo.