Companion
object Companion
Functions
Link copied to clipboard
Returns a new TopDocs, containing topN results across the provided TopDocs, sorting by score. Each TopDocs instance must be sorted.
Same as .merge but also ignores the top start top docs. This is typically useful for pagination.
Returns a new TopFieldDocs, containing topN results across the provided TopFieldDocs, sorting by the specified Sort. Each of the TopDocs must have been sorted by the same Sort, and sort field values must have been filled.
fun merge(start: Int, topN: Int, shardHits: Array<TopDocs>, tieBreaker: Comparator<ScoreDoc>): TopDocs
Same as above, but accepts the passed in tie breaker
fun merge(sort: Sort, start: Int, topN: Int, shardHits: Array<TopFieldDocs>, tieBreaker: Comparator<ScoreDoc>): TopFieldDocs
Pass in a custom tie breaker for ordering results
Link copied to clipboard
fun tieBreakLessThan(first: TopDocs.ShardRef, firstDoc: ScoreDoc, second: TopDocs.ShardRef, secondDoc: ScoreDoc, tieBreaker: Comparator<ScoreDoc>): Boolean
Use the tie breaker if provided. If tie breaker returns 0 signifying equal values, we use hit indices to tie break intra shard ties