Kademi's abstraction over Elasticsearch SearchHits to enable pluggable implementations. SearchHits represents a collection of search result documents.
Implements: Iterable
Properties
| Property | Returns | Description |
|---|---|---|
| empty | boolean | Whether this page holds no hits. |
| hits | KSearchHit[] | This page's matching documents, in the order returned by the search. Empty, never null, when nothing matched. |
| hitsList | List<KSearchHit> | This page's matching documents as a new mutable list, in the order returned by the search. Empty, never null, when nothing matched. |
| maxScore | float | Highest relevance score among the hits in this page. Zero when the query did not compute scores, for example a query sorted only by field value. |
| totalHits | long | Total number of documents that matched the search query, which can be larger than the number of hits actually returned by this page. |
Methods
getTotalHits()
Returns: long
Total number of documents that matched the search query, which can be larger than the number of hits actually returned by this page.
getMaxScore()
Returns: float
Highest relevance score among the hits in this page. Zero when the query did not compute scores, for example a query sorted only by field value.
getHits()
Returns: KSearchHit[]
This page's matching documents, in the order returned by the search. Empty, never null, when nothing matched.
getHitsList()
Returns: List<KSearchHit>
This page's matching documents as a new mutable list, in the order returned by the search. Empty, never null, when nothing matched.
getAt(int index)
Returns: KSearchHit
Looks up one hit in this page by its position.
| Parameter | Description |
|---|---|
index | the zero-based position of the hit to fetch |
size()
Returns: int
Number of hits actually held by this page, which can be smaller than getTotalHits when the result is paged.
isEmpty()
Returns: boolean
Whether this page holds no hits.