Skip to content

Repository files navigation

Trample

Build Status

Additional querying sugar for searchkick.

Why Trample?

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: searchendend

Or, 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

Install

$ gem install trample_search

or

gem'trample_search'

Usage

Check out the complete documentation, or see usage in the specs.

Specs

Run elasticsearch on port 9250 and bundle exec rspec.

Contributing

  1. Fork it ( https://github.com/fotinakis/swagger-blocks/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 a new Pull Request

About

Easily query elasticsearch given a client-side payload

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages