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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMgetRequest.BuilderBuilder forMgetRequest.Nested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>> -
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<MgetRequest>_DESERIALIZERJson deserializer forMgetRequeststatic SimpleEndpoint<MgetRequest,?>_ENDPOINTEndpoint "mget". -
Method Summary
Modifier and Type Method Description static <TDocument>
Endpoint<MgetRequest,MgetResponse<TDocument>,ErrorResponse>createMgetEndpoint(JsonpDeserializer<TDocument> tDocumentDeserializer)Create an "mget" endpoint.java.util.List<MultiGetOperation>docs()The documents you want to retrieve.java.util.List<java.lang.String>ids()The IDs of the documents you want to retrieve.java.lang.Stringindex()Name of the index to retrieve documents from whenidsare specified, or when a document in thedocsarray does not specify an index.static MgetRequestof(java.util.function.Function<MgetRequest.Builder,ObjectBuilder<MgetRequest>> fn)java.lang.Stringpreference()Specifies the node or shard the operation should be performed on.java.lang.Booleanrealtime()Iftrue, the request is real-time as opposed to near-real-time.java.lang.Booleanrefresh()Iftrue, the request refreshes relevant shards before retrieving documents.java.lang.Stringrouting()Custom value used to route operations to a specific shard.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)Serialize this object to JSON.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)protected static voidsetupMgetRequestDeserializer(ObjectDeserializer<MgetRequest.Builder> op)SourceConfigParamsource()True or false to return the_sourcefield or not, or a list of fields to return.java.util.List<java.lang.String>sourceExcludes()A comma-separated list of source fields to exclude from the response.java.util.List<java.lang.String>sourceIncludes()A comma-separated list of source fields to include in the response.java.util.List<java.lang.String>storedFields()Iftrue, retrieves the document fields stored in the index rather than the document_source.java.lang.Stringtype()The type of the documentMethods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
_DESERIALIZER
Json deserializer forMgetRequest -
_ENDPOINT
Endpoint "mget".
-
-
Method Details
-
of
public static MgetRequest of(java.util.function.Function<MgetRequest.Builder,ObjectBuilder<MgetRequest>> fn) -
source
True or false to return the_sourcefield 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_includesquery 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_excludesquery parameter. If the_sourceparameter isfalse, this parameter is ignored.API name:
_source_includes -
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 whenidsare specified, or when a document in thedocsarray 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()Iftrue, the request is real-time as opposed to near-real-time.API name:
realtime -
refresh
@Nullable public final java.lang.Boolean refresh()Iftrue, 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()Iftrue, retrieves the document fields stored in the index rather than the document_source.API name:
stored_fields -
type
@Nullable public final java.lang.String type()The type of the documentAPI name:
type -
serialize
Serialize this object to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
serializeInternal
-
setupMgetRequestDeserializer
-
createMgetEndpoint
public static <TDocument> Endpoint<MgetRequest,MgetResponse<TDocument>,ErrorResponse> createMgetEndpoint(JsonpDeserializer<TDocument> tDocumentDeserializer)Create an "mget" endpoint.
-