Class GetResult

org.elasticsearch.index.get.GetResult
All Implemented Interfaces:
<DocumentField>, Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject

public class GetResult extends implements <DocumentField>, org.elasticsearch.common.xcontent.ToXContentObject
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent

    org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params

    Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable

    Writeable.Reader<V>, Writeable.Writer<V>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static
     
    static
     
    static
     

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
     index,  type,  id, long seqNo, long primaryTerm, long version, boolean exists, BytesReference source, <,​DocumentField> documentFields, <,​DocumentField> metaFields)
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     o)
     
     name)
     
    static GetResult
    fromXContent​(org.elasticsearch.common.xcontent.XContentParser parser)
     
    static GetResult
    fromXContentEmbedded​(org.elasticsearch.common.xcontent.XContentParser parser)
     
    static GetResult
    fromXContentEmbedded​(org.elasticsearch.common.xcontent.XContentParser parser,  index,  type,  id)
     
     
     
    The id of the document.
    The index the document was fetched from.
     
    long
    The primary term of the last primary that has changed this document, if found.
    long
    The sequence number assigned to the last operation that has changed this document, if found.
    <,​>
     
    The type of the document.
    long
    The version of the doc.
    int
     
    Internal source representation, might be compressed....
    boolean
    Does the document exist.
    boolean
    Is the source empty (not available) or not.
     
    byte[]
    The source of the document if exists.
    <,​>
    The source of the document (As a map).
    The source of the document (as a string).
    Returns bytes reference, also un compress the source if needed.
     
    org.elasticsearch.common.xcontent.XContentBuilder
    toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
     
    org.elasticsearch.common.xcontent.XContentBuilder
    toXContentEmbedded​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
     
    void
    Write this into the StreamOutput.

    Methods inherited from class java.lang.

    , , , , , , ,

    Methods inherited from interface java.lang.

    ,

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject

    isFragment
  • Field Details

  • Constructor Details

    • GetResult

      public GetResult(StreamInput in) throws
      Throws:
    • GetResult

      public GetResult( index,  type,  id, long seqNo, long primaryTerm, long version, boolean exists, BytesReference source, <,​DocumentField> documentFields, <,​DocumentField> metaFields)
  • Method Details

    • isExists

      public boolean isExists()
      Does the document exist.
    • getIndex

      public  getIndex()
      The index the document was fetched from.
    • getType

      public  getType()
      The type of the document.
    • getId

      public  getId()
      The id of the document.
    • getVersion

      public long getVersion()
      The version of the doc.
    • getSeqNo

      public long getSeqNo()
      The sequence number assigned to the last operation that has changed this document, if found.
    • getPrimaryTerm

      public long getPrimaryTerm()
      The primary term of the last primary that has changed this document, if found.
    • source

      public byte[] source()
      The source of the document if exists.
    • sourceRef

      public BytesReference sourceRef()
      Returns bytes reference, also un compress the source if needed.
    • internalSourceRef

      public BytesReference internalSourceRef()
      Internal source representation, might be compressed....
    • isSourceEmpty

      public boolean isSourceEmpty()
      Is the source empty (not available) or not.
    • sourceAsString

      public  sourceAsString()
      The source of the document (as a string).
    • sourceAsMap

      public <,​> sourceAsMap() throws ElasticsearchParseException
      The source of the document (As a map).
      Throws:
      ElasticsearchParseException
    • getSource

      public <,​> getSource()
    • getMetadataFields

      public <,​DocumentField> getMetadataFields()
    • getDocumentFields

      public <,​DocumentField> getDocumentFields()
    • getFields

      public <,​DocumentField> getFields()
    • field

      public  name)
    • iterator

      public <DocumentField> iterator()
      Specified by:
       in interface <DocumentField>
    • toXContentEmbedded

      public org.elasticsearch.common.xcontent.XContentBuilder toXContentEmbedded(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws
      Throws:
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
    • fromXContentEmbedded

      public static GetResult fromXContentEmbedded(org.elasticsearch.common.xcontent.XContentParser parser) throws
      Throws:
    • fromXContentEmbedded

      public static GetResult fromXContentEmbedded(org.elasticsearch.common.xcontent.XContentParser parser,  index,  type,  id) throws
      Throws:
    • fromXContent

      public static GetResult fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws
      Throws:
    • writeTo

      public void writeTo(StreamOutput out) throws
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
    • equals

      public boolean equals( o)
      Overrides:
       in class 
    • hashCode

      public int hashCode()
      Overrides:
       in class 
    • toString

      public  toString()
      Overrides:
       in class