Mongoid / Active Record style query criteria DSL and Scoping for Ripple using RIAK's solr search interface. (riak_search must be enabled)

RippleSearchable adds named scopes, and chainable Criteria methods such as :where, :lt, :lte, :gt, :gte, :between along with :sort, :skip, :limit options to your Ripple::Document models.


Add this line to your application's Gemfile:

gem 'ripple_searchable'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ripple_searchable



Any of the following criteria can be chained:

:where, :lt, :lte, :gt, :gte, :between, with sort, :skip, :limit

=== Example:

  Product.where(tags: "nerd", name: "joe", something: 2).
    or({can_sell:1}, {can_sell: 3}).
    between(availibility: 1..3, price: [3, 12]).
    gte(quantity: 0, ratings: 5).
    sort(:created_at, :desc).limit(5)


Mongoid / Active Record style named scopes:

Use 'scope' class method to create a named scope that can be accessed from the class level or chained to criteria by the provided name.

=== Example:

  class Product
    include Ripple::Document

    scope :active, where(active: true)
    scope :avail, ->(count){ where(quantity: count)}


See docs for method details.


Ability to bypass default scopes when using named scopes Write better docs.


This gem is still under heavy development. Feel free to contribute.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request