Class: Chewy::Search::Parameters::Filter
- Includes:
- QueryStorage
- Defined in:
- lib/chewy/search/parameters/filter.rb
Overview
This parameter storage doesn't have its own parameter at the
ES request body. Instead, it is embedded to the root bool
query of the query
request parameter. Some additional query
reduction is performed in case of only several must
filters
presence.
Instance Attribute Summary
Attributes inherited from Storage
Instance Method Summary collapse
-
#render ⇒ {Symbol => Hash}
Even more reduction added here, we don't need to wrap with
bool
query consists onmust
only.
Methods included from QueryStorage
#and, #merge!, #minimum_should_match, #must, #must_not, #not, #or, #should, #update!
Methods inherited from Storage
#==, #initialize, #merge!, #replace!, #update!
Constructor Details
This class inherits a constructor from Chewy::Search::Parameters::Storage
Instance Method Details
#render ⇒ {Symbol => Hash}
Even more reduction added here, we don't need to wrap with
bool
query consists on must
only.
29 30 31 32 |
# File 'lib/chewy/search/parameters/filter.rb', line 29 def render rendered_bool = filter_query(value.query) {self.class.param_name => rendered_bool} if rendered_bool.present? end |