Class SearchHitSupport

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

public final class SearchHitSupport extends Object
Utility class with helper methods for working with SearchHit.
Since:
4.0
Author:
Peter-Josef Meisch, Sascha Woo, Roman Puchkovskiy
  • Method Details

    • unwrapSearchHits

      @Nullable public static Object unwrapSearchHits(@Nullable Object result)
      unwraps the data contained in a SearchHit for different types containing SearchHits if possible
      Parameters:
      result - the object, list, page or whatever containing SearchHit objects
      Returns:
      a corresponding object where the SearchHits are replaced by their content if possible, otherwise the original object
    • searchPageFor

      public static <T> SearchPage<T> searchPageFor(SearchHits<T> searchHits, @Nullable Pageable pageable)