Interface SearchResult<H>
- Type Parameters:
H
- The type of hits.
- All Known Subinterfaces:
ElasticsearchSearchResult<H>
,LuceneSearchResult<H>
- All Known Implementing Classes:
SimpleSearchResult
public interface SearchResult<H>
-
Method Summary
Modifier and TypeMethodDescription<A> A
aggregation
(AggregationKey<A> key) hits()
boolean
timedOut()
took()
total()
-
Method Details
-
total
SearchResultTotal total()- Returns:
- The total for a search result, pertaining to all matched documents, independently from the offset/limit used when fetching hits. Includes in particular the total hit count.
-
hits
- Returns:
- The hits as a
List
containing one element for each matched entity.
-
aggregation
- Type Parameters:
A
- The type of result for this aggregation.- Parameters:
key
- The key previously used to register the aggregation during query building.- Returns:
- The result for the given aggregation.
- Throws:
SearchException
- If the given key was never registered while building this query, and is thus not mapped to anything.
-
took
Duration took()- Returns:
- the time taken to process the request, as a
Duration
-
timedOut
boolean timedOut()- Returns:
- whether or not a timeout occurred processing the request.
-