Kademi's abstraction over Elasticsearch SearchHits to enable pluggable implementations. SearchHits represents a collection of search result documents.

Implements: Iterable


Properties

PropertyReturnsDescription
emptybooleanWhether this page holds no hits.
hitsKSearchHit[]This page's matching documents, in the order returned by the search. Empty, never null, when nothing matched.
hitsListList<KSearchHit>This page's matching documents as a new mutable list, in the order returned by the search. Empty, never null, when nothing matched.
maxScorefloatHighest 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.
totalHitslongTotal 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.

ParameterDescription
indexthe 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.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.