Class GetResult<TDocument>

java.lang.Object
co.elastic.clients.elasticsearch.core.get.GetResult<TDocument>
All Implemented Interfaces:
JsonpSerializable
Direct Known Subclasses:
GetResponse

@JsonpDeserializable public class GetResult<TDocument> extends Object implements JsonpSerializable
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getResultOf

      public static <TDocument> GetResult<TDocument> getResultOf(Function<GetResult.Builder<TDocument>,ObjectBuilder<GetResult<TDocument>>> fn)
    • index

      public final String index()
      Required - The name of the index the document belongs to.

      API name: _index

    • fields

      public final Map<String,JsonData> fields()
      If the stored_fields parameter is set to true and found is true, it contains the document fields stored in the index.

      API name: fields

    • ignored

      public final List<String> ignored()
      API name: _ignored
    • found

      public final boolean found()
      Required - Indicates whether the document exists.

      API name: found

    • id

      public final String id()
      Required - The unique identifier for the document.

      API name: _id

    • primaryTerm

      @Nullable public final Long primaryTerm()
      The primary term assigned to the document for the indexing operation.

      API name: _primary_term

    • routing

      @Nullable public final String routing()
      The explicit routing, if set.

      API name: _routing

    • seqNo

      @Nullable public final Long seqNo()
      The sequence number assigned to the document for the indexing operation. Sequence numbers are used to ensure an older version of a document doesn't overwrite a newer version.

      API name: _seq_no

    • source

      @Nullable public final TDocument source()
      If found is true, it contains the document data formatted in JSON. If the _source parameter is set to false or the stored_fields parameter is set to true, it is excluded.

      API name: _source

    • version

      @Nullable public final Long version()
      The document version, which is ncremented each time the document is updated.

      API name: _version

    • 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)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • createGetResultDeserializer

      public static <TDocument> JsonpDeserializer<GetResult<TDocument>> createGetResultDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer)
      Create a JSON deserializer for GetResult
    • setupGetResultDeserializer

      protected static <TDocument, BuilderT extends GetResult.AbstractBuilder<TDocument, BuilderT>> void setupGetResultDeserializer(ObjectDeserializer<BuilderT> op, JsonpDeserializer<TDocument> tDocumentDeserializer)