Class ExistsRequest.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • copy

      @Nonnull public ExistsRequest.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<ExistsRequest.Builder,ExistsRequest>
      Returns:
      a new builder instance.
    • self

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

      @Nonnull public final ExistsRequest.Builder id(String value)
      Required - Identifier of the document.

      API name: id

    • index

      @Nonnull public final ExistsRequest.Builder index(String value)
      Required - Comma-separated list of data streams, indexes, and aliases. Supports wildcards (*).

      API name: index

    • preference

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

      API name: preference

    • realtime

      @Nonnull public final ExistsRequest.Builder realtime(@Nullable Boolean value)
      If true, the request is real-time as opposed to near-real-time.

      API name: realtime

    • refresh

      @Nonnull public final ExistsRequest.Builder refresh(@Nullable Refresh value)
      If true, OpenSearch refreshes all shards involved in the delete by query after the request completes.

      API name: refresh

    • routing

      @Nonnull public final ExistsRequest.Builder routing(List<String> list)
      Target the specified primary shard.

      API name: routing

      Adds all elements of list to routing.

    • routing

      @Nonnull public final ExistsRequest.Builder routing(String value, String... values)
      Target the specified primary shard.

      API name: routing

      Adds one or more values to routing.

    • source

      @Nonnull public final ExistsRequest.Builder source(@Nullable SourceConfigParam value)
      true or false to return the _source field or not, or a list of fields to return.

      API name: _source

    • source

      true or false to return the _source field or not, or a list of fields to return.

      API name: _source

    • sourceExcludes

      @Nonnull public final ExistsRequest.Builder sourceExcludes(List<String> list)
      A comma-separated list of source fields to exclude in the response.

      API name: _source_excludes

      Adds all elements of list to sourceExcludes.

    • sourceExcludes

      @Nonnull public final ExistsRequest.Builder sourceExcludes(String value, String... values)
      A comma-separated list of source fields to exclude in the response.

      API name: _source_excludes

      Adds one or more values to sourceExcludes.

    • sourceIncludes

      @Nonnull public final ExistsRequest.Builder sourceIncludes(List<String> list)
      A comma-separated list of source fields to include in the response.

      API name: _source_includes

      Adds all elements of list to sourceIncludes.

    • sourceIncludes

      @Nonnull public final ExistsRequest.Builder sourceIncludes(String value, String... values)
      A comma-separated list of source fields to include in the response.

      API name: _source_includes

      Adds one or more values to sourceIncludes.

    • storedFields

      @Nonnull public final ExistsRequest.Builder storedFields(List<String> list)
      List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the _source parameter defaults to false.

      API name: stored_fields

      Adds all elements of list to storedFields.

    • storedFields

      @Nonnull public final ExistsRequest.Builder storedFields(String value, String... values)
      List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the _source parameter defaults to false.

      API name: stored_fields

      Adds one or more values to storedFields.

    • version

      @Nonnull public final ExistsRequest.Builder version(@Nullable Long value)
      Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.

      API name: version

    • versionType

      @Nonnull public final ExistsRequest.Builder versionType(@Nullable VersionType value)
      Specific version type: external, external_gte.

      API name: version_type

    • build

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