Method: Chewy::Search::Request#and
- Defined in:
- lib/chewy/search/request.rb
#and(other) ⇒ Chewy::Search::Request
Takes query, filter, post_filter from the passed scope
and performs QueryProxy#and operation for each
of them. Unlike merge, every other parameter is kept unmerged
(values from the first scope are used in the result scope).
814 815 816 817 818 819 820 |
# File 'lib/chewy/search/request.rb', line 814 i[and or not].each do |name| define_method name do |other| i[query filter post_filter].inject(self) do |scope, parameter_name| scope.send(parameter_name).send(name, other.parameters[parameter_name].value) end end end |