Class ReindexRequest.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • conflicts

      public final ReindexRequest.Builder conflicts(@Nullable Conflicts value)
      Indicates whether to continue reindexing even when there are conflicts.

      API name: conflicts

    • dest

      public final ReindexRequest.Builder dest(Destination value)
      Required - The destination you are copying to.

      API name: dest

    • dest

      Required - The destination you are copying to.

      API name: dest

    • maxDocs

      public final ReindexRequest.Builder maxDocs(@Nullable Long value)
      The maximum number of documents to reindex. By default, all documents are reindexed. If it is a value less then or equal to scroll_size, a scroll will not be used to retrieve the results for the operation.

      If conflicts is set to proceed, the reindex operation could attempt to reindex more documents from the source than max_docs until it has successfully indexed max_docs documents into the target or it has gone through every document in the source query.

      API name: max_docs

    • refresh

      public final ReindexRequest.Builder refresh(@Nullable Boolean value)
      If true, the request refreshes affected shards to make this operation visible to search.

      API name: refresh

    • requestsPerSecond

      public final ReindexRequest.Builder requestsPerSecond(@Nullable Float value)
      The throttle for this request in sub-requests per second. By default, there is no throttle.

      API name: requests_per_second

    • requireAlias

      public final ReindexRequest.Builder requireAlias(@Nullable Boolean value)
      If true, the destination must be an index alias.

      API name: require_alias

    • script

      public final ReindexRequest.Builder script(@Nullable Script value)
      The script to run to update the document source or metadata when reindexing.

      API name: script

    • script

      The script to run to update the document source or metadata when reindexing.

      API name: script

    • scroll

      public final ReindexRequest.Builder scroll(@Nullable Time value)
      The period of time that a consistent view of the index should be maintained for scrolled search.

      API name: scroll

    • scroll

      The period of time that a consistent view of the index should be maintained for scrolled search.

      API name: scroll

    • size

      public final ReindexRequest.Builder size(@Nullable Long value)
      API name: size
    • slices

      public final ReindexRequest.Builder slices(@Nullable Slices value)
      The number of slices this task should be divided into. It defaults to one slice, which means the task isn't sliced into subtasks.

      Reindex supports sliced scroll to parallelize the reindexing process. This parallelization can improve efficiency and provide a convenient way to break the request down into smaller parts.

      NOTE: Reindexing from remote clusters does not support manual or automatic slicing.

      If set to auto, Elasticsearch chooses the number of slices to use. This setting will use one slice per shard, up to a certain limit. If there are multiple sources, it will choose the number of slices based on the index or backing index with the smallest number of shards.

      API name: slices

    • slices

      The number of slices this task should be divided into. It defaults to one slice, which means the task isn't sliced into subtasks.

      Reindex supports sliced scroll to parallelize the reindexing process. This parallelization can improve efficiency and provide a convenient way to break the request down into smaller parts.

      NOTE: Reindexing from remote clusters does not support manual or automatic slicing.

      If set to auto, Elasticsearch chooses the number of slices to use. This setting will use one slice per shard, up to a certain limit. If there are multiple sources, it will choose the number of slices based on the index or backing index with the smallest number of shards.

      API name: slices

    • source

      public final ReindexRequest.Builder source(Source value)
      Required - The source you are copying from.

      API name: source

    • source

      Required - The source you are copying from.

      API name: source

    • timeout

      public final ReindexRequest.Builder timeout(@Nullable Time value)
      The period each indexing waits for automatic index creation, dynamic mapping updates, and waiting for active shards. By default, Elasticsearch waits for at least one minute before failing. The actual wait time could be longer, particularly when multiple waits occur.

      API name: timeout

    • timeout

      The period each indexing waits for automatic index creation, dynamic mapping updates, and waiting for active shards. By default, Elasticsearch waits for at least one minute before failing. The actual wait time could be longer, particularly when multiple waits occur.

      API name: timeout

    • waitForActiveShards

      public final ReindexRequest.Builder waitForActiveShards(@Nullable WaitForActiveShards value)
      The number of shard copies that must be active before proceeding with the operation. Set it to all or any positive integer up to the total number of shards in the index (number_of_replicas+1). The default value is one, which means it waits for each primary shard to be active.

      API name: wait_for_active_shards

    • waitForActiveShards

      The number of shard copies that must be active before proceeding with the operation. Set it to all or any positive integer up to the total number of shards in the index (number_of_replicas+1). The default value is one, which means it waits for each primary shard to be active.

      API name: wait_for_active_shards

    • waitForCompletion

      public final ReindexRequest.Builder waitForCompletion(@Nullable Boolean value)
      If true, the request blocks until the operation is complete.

      API name: wait_for_completion

    • self

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

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