Class SearchDocumentResponseBuilder

java.lang.Object
org.opensearch.data.client.orhlc.SearchDocumentResponseBuilder

public class SearchDocumentResponseBuilder extends Object
Factory class to create SearchDocumentResponse instances.
Since:
0.1
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> org.springframework.data.elasticsearch.core.document.SearchDocumentResponse
    from(org.opensearch.action.search.SearchResponse searchResponse, org.springframework.data.elasticsearch.core.document.SearchDocumentResponse.EntityCreator<T> entityCreator)
    creates a SearchDocumentResponse from the SearchResponse
    static <T> org.springframework.data.elasticsearch.core.document.SearchDocumentResponse
    from(org.opensearch.search.SearchHits searchHits, org.springframework.data.elasticsearch.core.SearchShardStatistics shardStatistics, String scrollId, org.opensearch.search.aggregations.Aggregations aggregations, org.opensearch.search.suggest.Suggest suggestOS, org.springframework.data.elasticsearch.core.document.SearchDocumentResponse.EntityCreator<T> entityCreator)
    creates a SearchDocumentResponseBuilder from SearchHits with the given scrollId aggregations and suggest

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SearchDocumentResponseBuilder

      public SearchDocumentResponseBuilder()
  • Method Details

    • from

      public static <T> org.springframework.data.elasticsearch.core.document.SearchDocumentResponse from(org.opensearch.action.search.SearchResponse searchResponse, org.springframework.data.elasticsearch.core.document.SearchDocumentResponse.EntityCreator<T> entityCreator)
      creates a SearchDocumentResponse from the SearchResponse
      Type Parameters:
      T - entity type
      Parameters:
      searchResponse - must not be null
      entityCreator - function to create an entity from a SearchDocument
      Returns:
      the SearchDocumentResponse
    • from

      public static <T> org.springframework.data.elasticsearch.core.document.SearchDocumentResponse from(org.opensearch.search.SearchHits searchHits, @Nullable org.springframework.data.elasticsearch.core.SearchShardStatistics shardStatistics, @Nullable String scrollId, @Nullable org.opensearch.search.aggregations.Aggregations aggregations, @Nullable org.opensearch.search.suggest.Suggest suggestOS, org.springframework.data.elasticsearch.core.document.SearchDocumentResponse.EntityCreator<T> entityCreator)
      creates a SearchDocumentResponseBuilder from SearchHits with the given scrollId aggregations and suggest
      Type Parameters:
      T - entity type
      Parameters:
      searchHits - the SearchHits to process
      scrollId - scrollId
      aggregations - aggregations
      suggestOS - the suggestion response from OpenSearch
      entityCreator - function to create an entity from a SearchDocument
      Returns:
      the SearchDocumentResponse