Class GetResult

    • Constructor Detail

      • GetResult

        public GetResult​(java.lang.String index,
                         java.lang.String type,
                         java.lang.String id,
                         long seqNo,
                         long primaryTerm,
                         long version,
                         boolean exists,
                         BytesReference source,
                         java.util.Map<java.lang.String,​DocumentField> fields)
    • Method Detail

      • isExists

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

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

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

        public java.lang.String 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 java.lang.String sourceAsString()
        The source of the document (as a string).
      • getSource

        public java.util.Map<java.lang.String,​java.lang.Object> getSource()
      • getFields

        public java.util.Map<java.lang.String,​DocumentField> getFields()
      • iterator

        public java.util.Iterator<DocumentField> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<DocumentField>
      • fromXContentEmbedded

        public static GetResult fromXContentEmbedded​(XContentParser parser)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • fromXContentEmbedded

        public static GetResult fromXContentEmbedded​(XContentParser parser,
                                                     java.lang.String index,
                                                     java.lang.String type,
                                                     java.lang.String id)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • fromXContent

        public static GetResult fromXContent​(XContentParser parser)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • readGetResult

        public static GetResult readGetResult​(StreamInput in)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object