Class: Chewy::Search::Parameters::None

Inherits:
Storage show all
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

#value

Instance Method Summary collapse

Methods included from BoolStorage

#update!

Methods inherited from Storage

#==, #initialize, #merge!, #replace!, #update!

Constructor Details

This class inherits a constructor from Chewy::Search::Parameters::Storage

Instance Method Details

#renderObject

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