Class MsearchRequest.Builder

java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.elasticsearch.core.MsearchRequest.Builder
All Implemented Interfaces:
ObjectBuilder<MsearchRequest>
Enclosing class:
MsearchRequest

public static class MsearchRequest.Builder
extends ObjectBuilderBase
implements ObjectBuilder<MsearchRequest>
Builder for MsearchRequest.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • allowNoIndices

      public final MsearchRequest.Builder allowNoIndices​(@Nullable java.lang.Boolean value)
      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. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.

      API name: allow_no_indices

    • ccsMinimizeRoundtrips

      public final MsearchRequest.Builder ccsMinimizeRoundtrips​(@Nullable java.lang.Boolean value)
      If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.

      API name: ccs_minimize_roundtrips

    • expandWildcards

      public final MsearchRequest.Builder expandWildcards​(java.util.List<ExpandWildcard> list)
      Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.

      API name: expand_wildcards

      Adds all elements of list to expandWildcards.

    • expandWildcards

      public final MsearchRequest.Builder expandWildcards​(ExpandWildcard value, ExpandWildcard... values)
      Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.

      API name: expand_wildcards

      Adds one or more values to expandWildcards.

    • ignoreThrottled

      public final MsearchRequest.Builder ignoreThrottled​(@Nullable java.lang.Boolean value)
      If true, concrete, expanded or aliased indices are ignored when frozen.

      API name: ignore_throttled

    • ignoreUnavailable

      public final MsearchRequest.Builder ignoreUnavailable​(@Nullable java.lang.Boolean value)
      If true, missing or closed indices are not included in the response.

      API name: ignore_unavailable

    • index

      public final MsearchRequest.Builder index​(java.util.List<java.lang.String> list)
      Comma-separated list of data streams, indices, and index aliases to search.

      API name: index

      Adds all elements of list to index.

    • index

      public final MsearchRequest.Builder index​(java.lang.String value, java.lang.String... values)
      Comma-separated list of data streams, indices, and index aliases to search.

      API name: index

      Adds one or more values to index.

    • maxConcurrentSearches

      public final MsearchRequest.Builder maxConcurrentSearches​(@Nullable java.lang.Long value)
      Maximum number of concurrent searches the multi search API can execute.

      API name: max_concurrent_searches

    • maxConcurrentShardRequests

      public final MsearchRequest.Builder maxConcurrentShardRequests​(@Nullable java.lang.Long value)
      Maximum number of concurrent shard requests that each sub-search request executes per node.

      API name: max_concurrent_shard_requests

    • preFilterShardSize

      public final MsearchRequest.Builder preFilterShardSize​(@Nullable java.lang.Long value)
      Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.

      API name: pre_filter_shard_size

    • searchType

      public final MsearchRequest.Builder searchType​(@Nullable SearchType value)
      Indicates whether global term and document frequencies should be used when scoring returned documents.

      API name: search_type

    • type

      public final MsearchRequest.Builder type​(java.util.List<java.lang.String> list)
      A comma-separated list of document types to use as default

      API name: type

      Adds all elements of list to type.

    • type

      public final MsearchRequest.Builder type​(java.lang.String value, java.lang.String... values)
      A comma-separated list of document types to use as default

      API name: type

      Adds one or more values to type.

    • searches

      public final MsearchRequest.Builder searches​(java.util.List<RequestItem> list)
      Required - Request body.

      API name: _value_body

      Adds all elements of list to searches.

    • searches

      public final MsearchRequest.Builder searches​(RequestItem value, RequestItem... values)
      Required - Request body.

      API name: _value_body

      Adds one or more values to searches.

    • searches

      public final MsearchRequest.Builder searches​(java.util.function.Function<RequestItem.Builder,​ObjectBuilder<RequestItem>> fn)
      Required - Request body.

      API name: _value_body

      Adds a value to searches using a builder lambda.

    • build

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