java.lang.Object
co.elastic.clients.elasticsearch._types.query_dsl.QueryBase
co.elastic.clients.elasticsearch._types.query_dsl.BoolQuery
All Implemented Interfaces:
QueryVariant, JsonpSerializable

@JsonpDeserializable public class BoolQuery extends QueryBase implements QueryVariant
See Also:
  • Field Details

  • Method Details

    • of

    • _queryKind

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

      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()
      Specifies the number or percentage of should clauses returned documents must match.

      API name: minimum_should_match

    • must

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

      API name: must

    • mustNot

      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

      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
    • setupBoolQueryDeserializer

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

      public boolean hasClauses()
      Returns true if this query has at least one should, must, must not or filter clause.