Additional querying sugar for searchkick.
Searchkick provides a nice query mechanism. But it doesn't provide a way to build up those queries, particularly syncing with UI input. Trample makes this simple:
class PeopleSearchesController < ApplicationController
def update
search = PeopleSearch.new(params[:people_search)
search.query!
render json: search
end
end
Or, build up queries manually:
search = PeopleSearch.new
search.condition(:security_level).in(%w(low medium)) unless current_user.admin?
search.paginate(size: 10, number: 2).sort("-age")
search.query!
search.results
$ gem install trample_search
or
gem 'trample_search'
Check out the complete documentation, or see usage in the specs.
Run elasticsearch on port 9250 and bundle exec rspec
.
- Fork it ( https://github.com/fotinakis/swagger-blocks/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request