Module: Chewie::Interface::Bool
- Included in:
- Chewie
- Defined in:
- lib/chewie/interface/bool.rb
Instance Method Summary collapse
- #filter_by(attribute, with:, combine: [], format: nil) ⇒ Hash
- #must_include(attribute, with:, combine: [], format: nil) ⇒ Hash
- #must_not_include(attribute, with:, combine: [], format: nil) ⇒ Hash
- #should_include(attribute, with:, combine: [], format: nil) ⇒ Hash
Instance Method Details
#filter_by(attribute, with:, combine: [], format: nil) ⇒ Hash
Note:
See README#filtering-by-associations use case for :combine and :filter options
www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/chewie/interface/bool.rb', line 12 def filter_by(attribute, with:, combine: [], format: nil) handler = { query: :filter, attribute: attribute, with: with, combine: combine, format: format, query_type: :bool, } set_handler(context: :bool, handler: handler) end |
#must_include(attribute, with:, combine: [], format: nil) ⇒ Hash
Note:
See README#filtering-by-associations use case for :combine and :filter options
www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html
51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/chewie/interface/bool.rb', line 51 def must_include(attribute, with:, combine: [], format: nil) handler = { query: :must, attribute: attribute, with: with, combine: combine, format: format, query_type: :bool, } set_handler(context: :bool, handler: handler) end |
#must_not_include(attribute, with:, combine: [], format: nil) ⇒ Hash
Note:
See README#filtering-by-associations use case for :combine and :filter options
www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/chewie/interface/bool.rb', line 38 def must_not_include(attribute, with:, combine: [], format: nil) handler = { query: :must_not, attribute: attribute, with: with, combine: combine, format: format, query_type: :bool, } set_handler(context: :bool, handler: handler) end |
#should_include(attribute, with:, combine: [], format: nil) ⇒ Hash
Note:
See README#filtering-by-associations use case for :combine and :filter options
www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/chewie/interface/bool.rb', line 25 def should_include(attribute, with:, combine: [], format: nil) handler = { query: :should, attribute: attribute, with: with, combine: combine, format: format, query_type: :bool, } set_handler(context: :bool, handler: handler) end |