Class GetSourceRequest

java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.core.GetSourceRequest

public class GetSourceRequest extends RequestBase
Get a document's source.

Get the source of a document. For example:

 GET my-index-000001/_source/1
 
 

You can use the source filtering parameters to control which parts of the _source are returned:

 GET my-index-000001/_source/1/?_source_includes=*.id&_source_excludes=entities
 
 
See Also:
  • Field Details

  • Method Details

    • of

    • source

      @Nullable public final SourceConfigParam source()
      Indicates whether to return the _source field (true or false) or lists the fields to return.

      API name: _source

    • sourceExcludes

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

      API name: _source_excludes

    • sourceIncludes

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

      API name: _source_includes

    • id

      public final String id()
      Required - A unique document identifier.

      API name: id

    • index

      public final String index()
      Required - The name of the index that contains the document.

      API name: index

    • preference

      @Nullable public final String preference()
      The node or shard the operation should be performed on. By default, the operation is randomized between the shard replicas.

      API name: preference

    • realtime

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

      API name: realtime

    • refresh

      @Nullable public final Boolean refresh()
      If true, the request refreshes the relevant shards before retrieving the document. Setting it to true should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).

      API name: refresh

    • routing

      @Nullable public final String routing()
      A custom value used to route operations to a specific shard.

      API name: routing

    • storedFields

      public final List<String> storedFields()
      A comma-separated list of stored fields to return as part of a hit.

      API name: stored_fields

    • version

      @Nullable public final Long version()
      The version number for concurrency control. It must match the current version of the document for the request to succeed.

      API name: version

    • versionType

      @Nullable public final VersionType versionType()
      The version type.

      API name: version_type

    • createGetSourceEndpoint

      public static <TDocument> Endpoint<GetSourceRequest,GetSourceResponse<TDocument>,ErrorResponse> createGetSourceEndpoint(JsonpDeserializer<TDocument> tDocumentDeserializer)
      Create an "get_source" endpoint.