Class DocumentAdapters

java.lang.Object
org.springframework.data.elasticsearch.client.erhlc.DocumentAdapters

@Deprecated public final class DocumentAdapters extends Object
Deprecated.
since 5.0
Utility class to adapt GetResponse, GetResult, MultiGetResponse SearchHit, DocumentField to Document.
Since:
4.0
Author:
Mark Paluch, Peter-Josef Meisch, Roman Puchkovskiy, Matt Gilene
  • Method Details

    • from

      @Nullable public static Document from(org.elasticsearch.action.get.GetResponse getResponse)
      Deprecated.
      Create a Document from GetResponse.

      Returns a Document using the getResponse if available.

      Parameters:
      getResponse - the getResponse GetResponse.
      Returns:
      the adapted Document, null if getResponse.isExists() returns false.
    • from

      @Nullable public static Document from(org.elasticsearch.index.get.GetResult source)
      Deprecated.
      Create a Document from GetResult.

      Returns a Document using the source if available.

      Parameters:
      source - the source GetResult.
      Returns:
      the adapted Document, null if source.isExists() returns false.
    • from

      public static List<MultiGetItem<Document>> from(org.elasticsearch.action.get.MultiGetResponse source)
      Deprecated.
      Creates a List of MultiGetItem<Document>s from MultiGetResponse.
      Parameters:
      source - the source MultiGetResponse, not null.
      Returns:
      a list of Documents, contains null values for not found Documents.
    • from

      public static MultiGetItem<Document> from(org.elasticsearch.action.get.MultiGetItemResponse itemResponse)
      Deprecated.
      Creates a MultiGetItem<Document> from a MultiGetItemResponse.
      Parameters:
      itemResponse - the response, must not be null
      Returns:
      the MultiGetItem
    • from

      public static SearchDocument from(org.elasticsearch.search.SearchHit source)
      Deprecated.
      Create a SearchDocument from SearchHit.

      Returns a SearchDocument using the source if available.

      Parameters:
      source - the source SearchHit.
      Returns:
      the adapted SearchDocument.
    • fromDocumentFields

      public static Document fromDocumentFields(Iterable<org.elasticsearch.common.document.DocumentField> documentFields, String index, String id, long version, long seqNo, long primaryTerm)
      Deprecated.
      Create an unmodifiable Document from Iterable of DocumentFields.
      Parameters:
      documentFields - the DocumentFields backing the Document.
      index - the index where the Document was found
      id - the document id
      version - the document version
      seqNo - the seqNo if the document
      primaryTerm - the primaryTerm of the document
      Returns:
      the adapted Document.