ChewyQueries

This gem help you to fire the Elastic query directly.This gem is completely depending on chewy gem (Elastic search) you will get more info in (https://github.com/toptal/chewy)

Getting started

Requirements

Add the gem to your Gemfile:

gem 'chewy_queries'

and run:

bundle install

or

gem install chewy_queries

require 'chewy_queries'

This gem requires Ruby 2.4+, Rails 5.0+ and Chewy 5.2.0

Search query requires the following

def ChewyQueries.search(class_name, type, condition, value, field)

some elastic queries

end

Above method includes all possible query to get the search result.

class_name should be your index class name

type is Fields types i.e:-

1)text 2)number 3)date

Condition required for each fields

1)text field

1)equal 2)not equal 3)contains 4)does not contain 5)starts with 6)does not start with 7)ends with 8)does not end with 9)matches exactly

2)number field

1)Is equal to 2)Is not equal to 3)Is greater than 4)Is less than 5)Is provided 6)Is not provided 7)Is between

3)date field

1)Is before 2)Is after 3)Is on or before 4)Is on or after 5)equals 6)does not equal 7)Is provided 8)Is not provided 9)Is between

value should be your search value

field should be your search filed