Class ResponseConverter

java.lang.Object
org.springframework.data.elasticsearch.core.ResponseConverter

public class ResponseConverter extends Object
Factory class to convert elasticsearch responses to different type of data classes.
Since:
4.2
Author:
George Popides, Peter-Josef Meisch, Sijia Liu
  • Method Details

    • aliasDatas

      public static Map<String,Set<AliasData>> aliasDatas(Map<String,Set<org.elasticsearch.cluster.metadata.AliasMetadata>> aliasesMetadatas)
    • toAliasData

      public static AliasData toAliasData(org.elasticsearch.cluster.metadata.AliasMetadata aliasMetaData)
    • getIndexInformations

      public static List<IndexInformation> getIndexInformations(org.elasticsearch.client.indices.GetIndexResponse getIndexResponse)
      get the index informations from a GetIndexResponse
      Parameters:
      getIndexResponse - the index response, must not be null
      Returns:
      list of IndexInformations for the different indices
    • getIndexInformations

      public static List<IndexInformation> getIndexInformations(org.elasticsearch.action.admin.indices.get.GetIndexResponse getIndexResponse)
      get the index informations from a GetIndexResponse (transport client)
      Parameters:
      getIndexResponse - the index response, must not be null
      Returns:
      list of IndexInformations for the different indices
    • getTemplateData

      @Nullable public static TemplateData getTemplateData(org.elasticsearch.client.indices.GetIndexTemplatesResponse getIndexTemplatesResponse, String templateName)
    • fromSettingsResponse

      public static Settings fromSettingsResponse(org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse response, String indexName)
      extract the index settings information for a given index
      Parameters:
      response - the Elasticsearch response
      indexName - the index name
      Returns:
      settings
    • getFailure

      @Nullable public static MultiGetItem.Failure getFailure(org.elasticsearch.action.get.MultiGetItemResponse itemResponse)
    • clusterHealth

      public static ClusterHealth clusterHealth(org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse clusterHealthResponse)
    • byQueryResponseOf

      public static ByQueryResponse byQueryResponseOf(org.elasticsearch.index.reindex.BulkByScrollResponse bulkByScrollResponse)
    • byQueryResponseFailureOf

      public static ByQueryResponse.Failure byQueryResponseFailureOf(org.elasticsearch.action.bulk.BulkItemResponse.Failure failure)
      Create a new ByQueryResponse.Failure from BulkItemResponse.Failure
      Parameters:
      failure - BulkItemResponse.Failure to translate
      Returns:
      a new ByQueryResponse.Failure
    • byQueryResponseSearchFailureOf

      public static ByQueryResponse.SearchFailure byQueryResponseSearchFailureOf(org.elasticsearch.index.reindex.ScrollableHitSource.SearchFailure searchFailure)
      Create a new ByQueryResponse.SearchFailure from ScrollableHitSource.SearchFailure
      Parameters:
      searchFailure - ScrollableHitSource.SearchFailure to translate
      Returns:
      a new ByQueryResponse.SearchFailure
    • reindexResponseOf

      public static ReindexResponse reindexResponseOf(org.elasticsearch.index.reindex.BulkByScrollResponse bulkByScrollResponse)
      Since:
      4.4
    • reindexResponseFailureOf

      public static ReindexResponse.Failure reindexResponseFailureOf(org.elasticsearch.action.bulk.BulkItemResponse.Failure failure)
      Since:
      4.4