Class MgetRequest

java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.core.MgetRequest
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable
public class MgetRequest
extends RequestBase
implements JsonpSerializable
Allows to get multiple documents in one request.
See Also:
API specification
  • Field Details

  • Method Details

    • of

      public static MgetRequest of​(java.util.function.Function<MgetRequest.Builder,​ObjectBuilder<MgetRequest>> fn)
    • source

      @Nullable public final SourceConfigParam source()
      True or false to return the _source field or not, or a list of fields to return.

      API name: _source

    • sourceExcludes

      public final java.util.List<java.lang.String> sourceExcludes()
      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

    • sourceIncludes

      public final java.util.List<java.lang.String> sourceIncludes()
      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

    • docs

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

      API name: docs

    • ids

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

      API name: ids

    • index

      @Nullable public final java.lang.String index()
      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

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

      API name: preference

    • realtime

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

      API name: realtime

    • refresh

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

      API name: refresh

    • routing

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

      API name: routing

    • storedFields

      public final java.util.List<java.lang.String> storedFields()
      If true, retrieves the document fields stored in the index rather than the document _source.

      API name: stored_fields

    • serialize

      public void serialize​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • setupMgetRequestDeserializer

      protected static void setupMgetRequestDeserializer​(ObjectDeserializer<MgetRequest.Builder> op)
    • createMgetEndpoint

      public static <TDocument> Endpoint<MgetRequest,​MgetResponse<TDocument>,​ErrorResponse> createMgetEndpoint​(JsonpDeserializer<TDocument> tDocumentDeserializer)
      Create an "mget" endpoint.