Class SearchShardsRequest.Builder

All Implemented Interfaces:
WithJson<SearchShardsRequest.Builder>, ObjectBuilder<SearchShardsRequest>
Enclosing class:
SearchShardsRequest

public static class SearchShardsRequest.Builder extends RequestBase.AbstractBuilder<SearchShardsRequest.Builder> implements ObjectBuilder<SearchShardsRequest>
Builder for SearchShardsRequest.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • allowNoIndices

      public final SearchShardsRequest.Builder allowNoIndices(@Nullable Boolean value)
      A setting that does two separate checks on the index expression. If false, the request returns an error (1) if any wildcard expression (including _all and *) resolves to zero matching indices or (2) if the complete set of resolved indices, aliases or data streams is empty after all expressions are evaluated. If true, index expressions that resolve to no indices are allowed and the request returns an empty result.

      API name: allow_no_indices

    • expandWildcards

      public final SearchShardsRequest.Builder expandWildcards(List<ExpandWildcard> list)
      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

      Adds all elements of list to expandWildcards.

    • expandWildcards

      public final SearchShardsRequest.Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values)
      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

      Adds one or more values to expandWildcards.

    • ignoreUnavailable

      public final SearchShardsRequest.Builder ignoreUnavailable(@Nullable Boolean value)
      If false, the request returns an error if it targets a concrete (non-wildcarded) index, alias, or data stream that is missing, closed, or otherwise unavailable. If true, unavailable concrete targets are silently ignored.

      API name: ignore_unavailable

    • index

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

      API name: index

      Adds all elements of list to index.

    • index

      public final SearchShardsRequest.Builder index(String value, String... values)
      A comma-separated list of data streams, indices, and aliases to search. It supports wildcards (*). To search all data streams and indices, omit this parameter or use * or _all.

      API name: index

      Adds one or more values to index.

    • local

      public final SearchShardsRequest.Builder local(@Nullable Boolean value)
      If true, the request retrieves information from the local node only.

      API name: local

    • masterTimeout

      public final SearchShardsRequest.Builder masterTimeout(@Nullable Time value)
      The period to wait for a connection to the master node. If the master node is not available before the timeout expires, the request fails and returns an error. IT can also be set to -1 to indicate that the request should never timeout.

      API name: master_timeout

    • masterTimeout

      The period to wait for a connection to the master node. If the master node is not available before the timeout expires, the request fails and returns an error. IT can also be set to -1 to indicate that the request should never timeout.

      API name: master_timeout

    • preference

      public final SearchShardsRequest.Builder preference(@Nullable String value)
      The node or shard the operation should be performed on. It is random by default.

      API name: preference

    • routeSlice

      public final SearchShardsRequest.Builder routeSlice(@Nullable String value)
      The slice identifier for routing the search to a specific slice. When provided, the request is limited to shards that match the given slice value. Use the special value _all to query all slices without restricting to a routing value. Required when index.slice.enabled is true for the target index; not allowed when index.slice.enabled is false.

      API name: _slice

    • routing

      public final SearchShardsRequest.Builder routing(List<String> list)
      A custom value used to route operations to a specific shard. Not allowed when index.slice.enabled is true for the target index; use _slice instead.

      API name: routing

      Adds all elements of list to routing.

    • routing

      public final SearchShardsRequest.Builder routing(String value, String... values)
      A custom value used to route operations to a specific shard. Not allowed when index.slice.enabled is true for the target index; use _slice instead.

      API name: routing

      Adds one or more values to routing.

    • self

      protected SearchShardsRequest.Builder self()
      Specified by:
      self in class RequestBase.AbstractBuilder<SearchShardsRequest.Builder>
    • build

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