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

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

#should(*args, &block) ⇒ Object



76
77
78
79
80
81
# File 'lib/elasticsearch/dsl/search/filters/bool.rb', line 76

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