Skip to content

Easily query elasticsearch given a client-side payload

License

Notifications You must be signed in to change notification settings

richmolj/trample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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:

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

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

License

Stars

Watchers

Forks

Packages

No packages published