Class: Chewy::Search::Parameters::None
- Includes:
- BoolStorage
- Defined in:
- lib/chewy/search/parameters/none.rb
Overview
Just a standard boolean storage, except the rendering logic.
Instance Attribute Summary
Attributes inherited from Storage
Instance Method Summary collapse
-
#render ⇒ Object
Renders
match_none
query if the values is set to true.
Methods included from BoolStorage
Methods inherited from Storage
#==, #initialize, #merge!, #replace!, #update!
Constructor Details
This class inherits a constructor from Chewy::Search::Parameters::Storage
Instance Method Details
#render ⇒ Object
Renders match_none
query if the values is set to true.
Well, we can't really use match none because we need to support
ES2, so we are simulating it with match_all
negation.
21 22 23 |
# File 'lib/chewy/search/parameters/none.rb', line 21 def render {query: {bool: {filter: {bool: {must_not: {match_all: {}}}}}}} if value.present? end |