Interface SearchHits<T>
- All Superinterfaces:
Iterable<SearchHit<T>>,Streamable<SearchHit<T>>,Supplier<Stream<SearchHit<T>>>
- All Known Implementing Classes:
SearchHitsImpl
-
Method Summary
Modifier and TypeMethodDescriptiongetSearchHit(int index) default longdefault TotalHitsRelationdefault booleaniterator()Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
hasSearchHits
default boolean hasSearchHits()- Returns:
- whether the
SearchHitshas search hits.
-
getExecutionDuration
Duration getExecutionDuration()- Returns:
- the execution duration it took to complete the request
-
getSearchHit
- Parameters:
index- position in List.- Returns:
- the
SearchHitat position {index} - Throws:
IndexOutOfBoundsException- on invalid index
-
getSearchHits
- Returns:
- the contained
SearchHits.
-
getTotalHits
default long getTotalHits()- Returns:
- the reported total-hit metadata only when
getTotalHitsRelation()isTotalHitsRelation.EQUAL_TO; otherwise the loaded hit count, which is not usable as a page total.
-
getTotalHitsRelation
- Returns:
- how
getTotalHits()relates to the reported total-hit metadata. OnlyTotalHitsRelation.EQUAL_TOmarks total-hit metadata reported by the search response.
-
iterator
-