Class CountRequest.Builder

All Implemented Interfaces:
CopyableBuilder<CountRequest.Builder,CountRequest>, MutableBuilder<CountRequest.Builder,CountRequest>, ObjectBuilder<CountRequest>
Enclosing class:
CountRequest

public static class CountRequest.Builder extends RequestBase.AbstractBuilder<CountRequest.Builder> implements CopyableBuilder<CountRequest.Builder,CountRequest>
Builder for CountRequest.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • copy

      @Nonnull public CountRequest.Builder copy()
      Description copied from interface: CopyableBuilder
      Create a new builder CopyableBuilder that is a copy of this one.
      Specified by:
      copy in interface CopyableBuilder<CountRequest.Builder,CountRequest>
      Returns:
      a new builder instance.
    • self

      @Nonnull protected CountRequest.Builder self()
      Specified by:
      self in class RequestBase.AbstractBuilder<CountRequest.Builder>
    • allowNoIndices

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

      API name: allow_no_indices

    • analyzeWildcard

      @Nonnull public final CountRequest.Builder analyzeWildcard(@Nullable Boolean value)
      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

      @Nonnull public final CountRequest.Builder analyzer(@Nullable String value)
      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

      @Nonnull public final CountRequest.Builder defaultOperator(@Nullable Operator value)
      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

      @Nonnull public final CountRequest.Builder df(@Nullable String value)
      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

      @Nonnull public final CountRequest.Builder expandWildcards(List<ExpandWildcard> list)
      Specifies the type of index that wildcard expressions can match. Supports comma-separated values.

      API name: expand_wildcards

      Adds all elements of list to expandWildcards.

    • expandWildcards

      @Nonnull public final CountRequest.Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values)
      Specifies the type of index that wildcard expressions can match. Supports comma-separated values.

      API name: expand_wildcards

      Adds one or more values to expandWildcards.

    • ignoreThrottled

      @Nonnull public final CountRequest.Builder ignoreThrottled(@Nullable Boolean value)
      If true, concrete, expanded or aliased indexes are ignored when frozen.

      API name: ignore_throttled

    • ignoreUnavailable

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

      API name: ignore_unavailable

    • index

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

      API name: index

      Adds all elements of list to index.

    • index

      @Nonnull public final CountRequest.Builder index(String value, String... values)
      Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (*). To search all data streams and indexes, omit this parameter or use * or _all.

      API name: index

      Adds one or more values to index.

    • lenient

      @Nonnull public final CountRequest.Builder lenient(@Nullable Boolean value)
      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

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

      API name: min_score

    • preference

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

      API name: preference

    • q

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

      API name: q

    • query

      @Nonnull public final CountRequest.Builder query(@Nullable Query value)
      API name: query
    • query

      @Nonnull public final CountRequest.Builder query(Function<Query.Builder,ObjectBuilder<Query>> fn)
      API name: query
    • routing

      @Nonnull public final CountRequest.Builder routing(List<String> list)
      Custom value used to route operations to a specific shard.

      API name: routing

      Adds all elements of list to routing.

    • routing

      @Nonnull public final CountRequest.Builder routing(String value, String... values)
      Custom value used to route operations to a specific shard.

      API name: routing

      Adds one or more values to routing.

    • terminateAfter

      @Nonnull public final CountRequest.Builder terminateAfter(@Nullable Integer value)
      Maximum number of documents to collect for each shard. If a query reaches this limit, OpenSearch terminates the query early. OpenSearch collects documents before sorting.

      API name: terminate_after

    • build

      @Nonnull public CountRequest build()
      Builds a CountRequest.
      Specified by:
      build in interface ObjectBuilder<CountRequest>
      Throws:
      NullPointerException - if some of the required fields are null.