Class GetRequest.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • source

      public final GetRequest.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

      public final GetRequest.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

      public final GetRequest.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

      public final GetRequest.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

      public final GetRequest.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.

    • id

      public final GetRequest.Builder id(String value)
      Required - Unique identifier of the document.

      API name: id

    • index

      public final GetRequest.Builder index(String value)
      Required - Name of the index that contains the document.

      API name: index

    • preference

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

      API name: preference

    • realtime

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

      API name: realtime

    • refresh

      public final GetRequest.Builder refresh(@Nullable Boolean value)
      If true, Elasticsearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes.

      API name: refresh

    • routing

      public final GetRequest.Builder routing(@Nullable String value)
      Target the specified primary shard.

      API name: routing

    • storedFields

      public final GetRequest.Builder storedFields(List<String> list)
      A comma-separated list of stored fields to return in the response

      API name: stored_fields

      Adds all elements of list to storedFields.

    • storedFields

      public final GetRequest.Builder storedFields(String value, String... values)
      A comma-separated list of stored fields to return in the response

      API name: stored_fields

      Adds one or more values to storedFields.

    • version

      public final GetRequest.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

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

      API name: version_type

    • self

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

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