Class SearchHitsImpl<T>
java.lang.Object
io.vanslog.spring.data.meilisearch.core.SearchHitsImpl<T>
- All Implemented Interfaces:
SearchHits<T>,Iterable<SearchHit<T>>,Supplier<Stream<SearchHit<T>>>,Streamable<SearchHit<T>>
-
Constructor Summary
ConstructorsConstructorDescriptionSearchHitsImpl(Duration executionDuration, List<? extends SearchHit<T>> searchHits) SearchHitsImpl(Duration executionDuration, List<? extends SearchHit<T>> searchHits, long totalHits, TotalHitsRelation totalHitsRelation) -
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 io.vanslog.spring.data.meilisearch.core.SearchHits
hasSearchHits, iterator
-
Constructor Details
-
SearchHitsImpl
-
SearchHitsImpl
public SearchHitsImpl(Duration executionDuration, List<? extends SearchHit<T>> searchHits, long totalHits, TotalHitsRelation totalHitsRelation)
-
-
Method Details
-
getExecutionDuration
- Specified by:
getExecutionDurationin interfaceSearchHits<T>- Returns:
- the execution duration it took to complete the request
-
getSearchHit
- Specified by:
getSearchHitin interfaceSearchHits<T>- Parameters:
index- position in List.- Returns:
- the
SearchHitat position {index}
-
getSearchHits
- Specified by:
getSearchHitsin interfaceSearchHits<T>- Returns:
- the contained
SearchHits.
-
getTotalHits
public long getTotalHits()- Specified by:
getTotalHitsin interfaceSearchHits<T>- Returns:
- the reported total-hit metadata only when
SearchHits.getTotalHitsRelation()isTotalHitsRelation.EQUAL_TO; otherwise the loaded hit count, which is not usable as a page total.
-
getTotalHitsRelation
- Specified by:
getTotalHitsRelationin interfaceSearchHits<T>- Returns:
- how
SearchHits.getTotalHits()relates to the reported total-hit metadata. OnlyTotalHitsRelation.EQUAL_TOmarks total-hit metadata reported by the search response.
-
toString
-