Skip to content

New-Bamboo/configurable_search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Configurable Search

Configurable parameters for your elastic search queries. Like strong params, but, like, better.

Dependencies

It works with Tire at the minute and depends on a lot of Rails things. Expect it to change in future.

Installation

Add this line to your application's Gemfile:

gem 'configurable_search'

And then execute:

$ bundle

Or install it yourself as:

$ gem install configurable_search

Usage

Mix it in to your class to enjoy the DSL niceness...

class AwesomeSearch

  include ConfigurableSearch

  # State which model should be used for searching
  search_for Awesome

  # Add the options you want to be passed into the query
  # anything not here will be ommitted
  search_option :volume, default: 11, label: 'Volume level'

  # Define the query itself
  def query
    search do |s|
      ...
    end
  end
end

Contributing

  1. Fork it ( http://github.com//configurable_search/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

Configurable parameters for your elastic search queries

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages