Class DeleteRequest.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • id

      public final DeleteRequest.Builder id(String value)
      Required - A unique identifier for the document.

      API name: id

    • ifPrimaryTerm

      public final DeleteRequest.Builder ifPrimaryTerm(@Nullable Long value)
      Only perform the operation if the document has this primary term.

      API name: if_primary_term

    • ifSeqNo

      public final DeleteRequest.Builder ifSeqNo(@Nullable Long value)
      Only perform the operation if the document has this sequence number.

      API name: if_seq_no

    • index

      public final DeleteRequest.Builder index(String value)
      Required - The name of the target index.

      API name: index

    • refresh

      public final DeleteRequest.Builder refresh(@Nullable Refresh value)
      If true, Elasticsearch refreshes the affected shards to make this operation visible to search. If wait_for, it waits for a refresh to make this operation visible to search. If false, it does nothing with refreshes.

      API name: refresh

    • routeSlice

      public final DeleteRequest.Builder routeSlice(@Nullable String value)
      The slice identifier used to route the operation to a specific slice. Use the special value _all to target 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 DeleteRequest.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 DeleteRequest.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.

    • timeout

      public final DeleteRequest.Builder timeout(@Nullable Time value)
      The period to wait for active shards.

      This parameter is useful for situations where the primary shard assigned to perform the delete operation might not be available when the delete operation runs. Some reasons for this might be that the primary shard is currently recovering from a store or undergoing relocation. By default, the delete operation will wait on the primary shard to become available for up to 1 minute before failing and responding with an error.

      API name: timeout

    • timeout

      The period to wait for active shards.

      This parameter is useful for situations where the primary shard assigned to perform the delete operation might not be available when the delete operation runs. Some reasons for this might be that the primary shard is currently recovering from a store or undergoing relocation. By default, the delete operation will wait on the primary shard to become available for up to 1 minute before failing and responding with an error.

      API name: timeout

    • version

      public final DeleteRequest.Builder version(@Nullable Long value)
      An explicit version number for concurrency control. It must match the current version of the document for the request to succeed.

      API name: version

    • versionType

      public final DeleteRequest.Builder versionType(@Nullable VersionType value)
      The version type.

      API name: version_type

    • waitForActiveShards

      public final DeleteRequest.Builder waitForActiveShards(@Nullable WaitForActiveShards value)
      The minimum number of shard copies that must be active before proceeding with the operation. You can 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 of 1 means it waits for each primary shard to be active.

      API name: wait_for_active_shards

    • waitForActiveShards

      The minimum number of shard copies that must be active before proceeding with the operation. You can 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 of 1 means it waits for each primary shard to be active.

      API name: wait_for_active_shards

    • self

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

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