Class CountRequest

java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.core.CountRequest
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable public class CountRequest extends RequestBase implements JsonpSerializable
Returns number of documents matching a query.
See Also:
  • Field Details

  • Method Details

    • of

    • allowNoIndices

      @Nullable public final Boolean allowNoIndices()
      If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

      API name: allow_no_indices

    • analyzeWildcard

      @Nullable public final Boolean analyzeWildcard()
      If true, wildcard and prefix queries are analyzed. This parameter can only be used when the q query string parameter is specified.

      API name: analyze_wildcard

    • analyzer

      @Nullable public final String analyzer()
      Analyzer to use for the query string. This parameter can only be used when the q query string parameter is specified.

      API name: analyzer

    • defaultOperator

      @Nullable public final Operator defaultOperator()
      The default operator for query string query: AND or OR. This parameter can only be used when the q query string parameter is specified.

      API name: default_operator

    • df

      @Nullable public final String df()
      Field to use as default where no field prefix is given in the query string. This parameter can only be used when the q query string parameter is specified.

      API name: df

    • expandWildcards

      public final List<ExpandWildcard> expandWildcards()
      Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden.

      API name: expand_wildcards

    • ignoreThrottled

      @Nullable public final Boolean ignoreThrottled()
      If true, concrete, expanded or aliased indices are ignored when frozen.

      API name: ignore_throttled

    • ignoreUnavailable

      @Nullable public final Boolean ignoreUnavailable()
      If false, the request returns an error if it targets a missing or closed index.

      API name: ignore_unavailable

    • index

      public final List<String> index()
      Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (*). To search all data streams and indices, omit this parameter or use * or _all.

      API name: index

    • lenient

      @Nullable public final Boolean lenient()
      If true, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.

      API name: lenient

    • minScore

      @Nullable public final Double minScore()
      Sets the minimum _score value that documents must have to be included in the result.

      API name: min_score

    • preference

      @Nullable public final String preference()
      Specifies the node or shard the operation should be performed on. Random by default.

      API name: preference

    • q

      @Nullable public final String q()
      Query in the Lucene query string syntax.

      API name: q

    • query

      @Nullable public final Query query()
      Defines the search definition using the Query DSL.

      API name: query

    • routing

      @Nullable public final String routing()
      Custom value used to route operations to a specific shard.

      API name: routing

    • terminateAfter

      @Nullable public final Long terminateAfter()
      Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting.

      API name: terminate_after

    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • setupCountRequestDeserializer

      protected static void setupCountRequestDeserializer(ObjectDeserializer<CountRequest.Builder> op)