java.lang.Object
org.opensearch.client.opensearch._types.query_dsl.QueryBase
org.opensearch.client.opensearch._types.query_dsl.BoolQuery
All Implemented Interfaces:
JsonpSerializable, PlainJsonSerializable, QueryVariant, ToCopyableBuilder<BoolQuery.Builder,BoolQuery>

@JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") public class BoolQuery extends QueryBase implements QueryVariant, ToCopyableBuilder<BoolQuery.Builder,BoolQuery>
  • Field Details

  • Method Details

    • of

    • _queryKind

      public Query.Kind _queryKind()
      Query variant kind.
      Specified by:
      _queryKind in interface QueryVariant
    • adjustPureNegative

      @Nullable public final Boolean adjustPureNegative()
      Ensures correct behavior when a query contains only must_not clauses. By default set to true, OpenSearch adds a match-all clause to ensure results are returned from Lucene, with the must_not conditions applied as filters. If set to false, the query may return no results, as Lucene typically requires at least one positive condition.

      API name: adjust_pure_negative

    • filter

      @Nonnull public final List<Query> filter()
      The clause (query) must appear in matching documents. However, unlike must, the score of the query will be ignored.

      API name: filter

    • minimumShouldMatch

      @Nullable public final String minimumShouldMatch()
      API name: minimum_should_match
    • must

      @Nonnull public final List<Query> must()
      The clause (query) must appear in matching documents and will contribute to the score.

      API name: must

    • mustNot

      @Nonnull public final List<Query> mustNot()
      The clause (query) must not appear in the matching documents. Because scoring is ignored, a score of 0 is returned for all documents.

      API name: must_not

    • should

      @Nonnull public final List<Query> should()
      The clause (query) should appear in the matching document.

      API name: should

    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Overrides:
      serializeInternal in class QueryBase
    • toBuilder

      @Nonnull public BoolQuery.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Create a new builder ToCopyableBuilder that is initialised with the current state of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<BoolQuery.Builder,BoolQuery>
      Returns:
      a new builder instance.
    • builder

      @Nonnull public static BoolQuery.Builder builder()
    • setupBoolQueryDeserializer

      protected static void setupBoolQueryDeserializer(ObjectDeserializer<BoolQuery.Builder> op)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class QueryBase
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class QueryBase