Class MgetRequest.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • source

      public final MgetRequest.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 MgetRequest.Builder sourceExcludes(List<String> list)
      A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in _source_includes query parameter.

      API name: _source_excludes

      Adds all elements of list to sourceExcludes.

    • sourceExcludes

      public final MgetRequest.Builder sourceExcludes(String value, String... values)
      A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in _source_includes query parameter.

      API name: _source_excludes

      Adds one or more values to sourceExcludes.

    • sourceIncludes

      public final MgetRequest.Builder sourceIncludes(List<String> list)
      A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the _source_excludes query parameter. If the _source parameter is false, this parameter is ignored.

      API name: _source_includes

      Adds all elements of list to sourceIncludes.

    • sourceIncludes

      public final MgetRequest.Builder sourceIncludes(String value, String... values)
      A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the _source_excludes query parameter. If the _source parameter is false, this parameter is ignored.

      API name: _source_includes

      Adds one or more values to sourceIncludes.

    • docs

      public final MgetRequest.Builder docs(List<MultiGetOperation> list)
      The documents you want to retrieve. Required if no index is specified in the request URI.

      API name: docs

      Adds all elements of list to docs.

    • docs

      public final MgetRequest.Builder docs(MultiGetOperation value, MultiGetOperation... values)
      The documents you want to retrieve. Required if no index is specified in the request URI.

      API name: docs

      Adds one or more values to docs.

    • docs

      The documents you want to retrieve. Required if no index is specified in the request URI.

      API name: docs

      Adds a value to docs using a builder lambda.

    • ids

      public final MgetRequest.Builder ids(List<String> list)
      The IDs of the documents you want to retrieve. Allowed when the index is specified in the request URI.

      API name: ids

      Adds all elements of list to ids.

    • ids

      public final MgetRequest.Builder ids(String value, String... values)
      The IDs of the documents you want to retrieve. Allowed when the index is specified in the request URI.

      API name: ids

      Adds one or more values to ids.

    • index

      public final MgetRequest.Builder index(@Nullable String value)
      Name of the index to retrieve documents from when ids are specified, or when a document in the docs array does not specify an index.

      API name: index

    • preference

      public final MgetRequest.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 MgetRequest.Builder realtime(@Nullable Boolean value)
      If true, the request is real-time as opposed to near-real-time.

      API name: realtime

    • refresh

      public final MgetRequest.Builder refresh(@Nullable Boolean value)
      If true, the request refreshes relevant shards before retrieving documents.

      API name: refresh

    • routing

      public final MgetRequest.Builder routing(@Nullable String value)
      Custom value used to route operations to a specific shard.

      API name: routing

    • storedFields

      public final MgetRequest.Builder storedFields(List<String> list)
      If true, retrieves the document fields stored in the index rather than the document _source.

      API name: stored_fields

      Adds all elements of list to storedFields.

    • storedFields

      public final MgetRequest.Builder storedFields(String value, String... values)
      If true, retrieves the document fields stored in the index rather than the document _source.

      API name: stored_fields

      Adds one or more values to storedFields.

    • self

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

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