Method: Elasticsearch::DSL::Search::Filters::Bool#must_not

Defined in:
lib/elasticsearch/dsl/search/filters/bool.rb

#must_not(*args, &block) ⇒ Object



69
70
71
72
73
74
# File 'lib/elasticsearch/dsl/search/filters/bool.rb', line 69

def must_not(*args, &block)
  @hash[name][:must_not] ||= []
  value = args.empty? ? Filter.new(*args, &block).to_hash : args.first.to_hash
  @hash[name][:must_not].push(value).flatten! unless @hash[name][:must_not].include?(value)
  self
end