class OpenSearch::DSL::Search::Filters::And

A compound filter which matches documents by an intersection of individual filters.

@note Since ‘and` is a keyword in Ruby, use the `_and` method in DSL definitions

@example Pass the filters as a Hash

search do
  query do
    filtered do
      filter do
        _and filters: [ {term: { color: 'red' }}, {term: { size:  'xxl' }} ]
      end
    end
  end
end

@example Define the filters with a block

search do
  query do
    filtered do
      filter do
        _and do
          term color: 'red'
          term size:  'xxl'
        end
      end
    end
  end
end

@see opensearch.org/guide/en/opensearch/reference/current/query-dsl-and-filter.html