Class: Boolminot::Clauses::MatchNone

Inherits:
Logica::Predicates::Contradiction
  • Object
show all
Extended by:
Base::ClassMethods
Includes:
Base::InstanceMethods
Defined in:
lib/boolminot/clauses/match_none.rb

Instance Method Summary collapse

Methods included from Base::ClassMethods

predicate_factory

Methods included from Base::InstanceMethods

#satisfied_by?, #to_elasticsearch_negated

Constructor Details

#initialize(opts = {}) ⇒ MatchNone

Returns a new instance of MatchNone.



7
8
9
# File 'lib/boolminot/clauses/match_none.rb', line 7

def initialize(opts = {})
  @opts = opts
end

Instance Method Details

#to_elasticsearch(options = {}) ⇒ Object

only for compatibility with Elasticsearch 1.x and 2.x otherwise, defining body as opts would suffice



13
14
15
# File 'lib/boolminot/clauses/match_none.rb', line 13

def to_elasticsearch(options = {})
  to_raw_bool(options)
end

#to_raw_bool(options = {}) ⇒ Object



17
18
19
# File 'lib/boolminot/clauses/match_none.rb', line 17

def to_raw_bool(options = {})
  { bool: { must_not: [negated.to_elasticsearch(options)] } }
end