Interface SearchHits<T>
- Type Parameters:
T
- the result data class.
- All Superinterfaces:
Iterable<SearchHit<T>>
,Streamable<SearchHit<T>>
,Supplier<Stream<SearchHit<T>>>
- All Known Subinterfaces:
SearchScrollHits<T>
- All Known Implementing Classes:
SearchHitsImpl
Encapsulates a list of
SearchHit
s with additional information from the search.- Since:
- 4.0
- Author:
- Sascha Woo
-
Method Summary
Modifier and TypeMethodDescriptionfloat
When doing a search with a point in time, the response contains a new point in time id value.getSearchHit
(int index) long
default boolean
default boolean
default boolean
iterator()
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getAggregations
- Returns:
- the aggregations.
-
getMaxScore
float getMaxScore()- Returns:
- the maximum score
-
getSearchHit
- Parameters:
index
- position in List.- Returns:
- the
SearchHit
at position {index} - Throws:
IndexOutOfBoundsException
- on invalid index
-
getSearchHits
- Returns:
- the contained
SearchHit
s.
-
getTotalHits
long getTotalHits()- Returns:
- the number of total hits.
-
getTotalHitsRelation
TotalHitsRelation getTotalHitsRelation()- Returns:
- the relation for the total hits
-
hasAggregations
default boolean hasAggregations()- Returns:
- true if aggregations are available
-
hasSearchHits
default boolean hasSearchHits()- Returns:
- whether the
SearchHits
has search hits.
-
getSuggest
- Returns:
- the suggest response
- Since:
- 4.3
-
hasSuggest
default boolean hasSuggest()- Returns:
- wether the
SearchHits
has a suggest response. - Since:
- 4.3
-
iterator
-
getPointInTimeId
When doing a search with a point in time, the response contains a new point in time id value.- Returns:
- the new point in time id, if one was returned from Elasticsearch
- Since:
- 5.0
-