Class SearchHitsImpl<T>
java.lang.Object
org.springframework.data.elasticsearch.core.SearchHitsImpl<T>
- Type Parameters:
T- the result data class.
- All Implemented Interfaces:
Iterable<SearchHit<T>>,Supplier<Stream<SearchHit<T>>>,SearchHits<T>,SearchScrollHits<T>,Streamable<SearchHit<T>>
Basic implementation of
SearchScrollHits- Since:
- 4.0
- Author:
- Peter-Josef Meisch, Sascha Woo
-
Constructor Summary
ConstructorsConstructorDescriptionSearchHitsImpl(long totalHits, TotalHitsRelation totalHitsRelation, float maxScore, String scrollId, List<? extends SearchHit<T>> searchHits, AggregationsContainer<?> aggregations, Suggest suggest) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.springframework.data.elasticsearch.core.SearchHits
hasAggregations, hasSearchHits, hasSuggest, iterator
-
Constructor Details
-
SearchHitsImpl
public SearchHitsImpl(long totalHits, TotalHitsRelation totalHitsRelation, float maxScore, @Nullable String scrollId, List<? extends SearchHit<T>> searchHits, @Nullable AggregationsContainer<?> aggregations, @Nullable Suggest suggest) - Parameters:
totalHits- the number of total hits for the searchtotalHitsRelation- the relation , must not be nullmaxScore- the maximum scorescrollId- the scroll id if availablesearchHits- must not be nullaggregations- the aggregations if available
-
-
Method Details
-
getTotalHits
public long getTotalHits()- Specified by:
getTotalHitsin interfaceSearchHits<T>- Returns:
- the number of total hits.
-
getTotalHitsRelation
- Specified by:
getTotalHitsRelationin interfaceSearchHits<T>- Returns:
- the relation for the total hits
-
getMaxScore
public float getMaxScore()- Specified by:
getMaxScorein interfaceSearchHits<T>- Returns:
- the maximum score
-
getScrollId
- Specified by:
getScrollIdin interfaceSearchScrollHits<T>- Returns:
- the scroll id
-
getSearchHits
- Specified by:
getSearchHitsin interfaceSearchHits<T>- Returns:
- the contained
SearchHits.
-
getSearchHit
- Specified by:
getSearchHitin interfaceSearchHits<T>- Parameters:
index- position in List.- Returns:
- the
SearchHitat position {index}
-
getAggregations
- Specified by:
getAggregationsin interfaceSearchHits<T>- Returns:
- the aggregations.
-
getSuggest
- Specified by:
getSuggestin interfaceSearchHits<T>- Returns:
- the suggest response
-
toString
-