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:
classPeopleSearchesController < ApplicationControllerdefupdatesearch=PeopleSearch.new(params[:people_search)search.query!renderjson: searchendendOr, build up queries manually:
search=PeopleSearch.newsearch.condition(:security_level).in(%w(lowmedium))unlesscurrent_user.admin?search.paginate(size: 10,number: 2).sort("-age")search.query!search.results$ gem install trample_searchor
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