merge

fun merge(topN: Int, shardHits: Array<TopDocs>): TopDocs

Returns a new TopDocs, containing topN results across the provided TopDocs, sorting by score. Each TopDocs instance must be sorted.

See also

.merge


fun merge(start: Int, topN: Int, shardHits: Array<TopDocs>): TopDocs
fun merge(sort: Sort, start: Int, topN: Int, shardHits: Array<TopFieldDocs>): TopFieldDocs

Same as .merge but also ignores the top start top docs. This is typically useful for pagination.

docIDs are expected to be in consistent pattern i.e. either all ScoreDocs have their shardIndex set, or all have them as -1 (signifying that all hits belong to same searcher)


fun merge(start: Int, topN: Int, shardHits: Array<TopDocs>, tieBreaker: Comparator<ScoreDoc>): TopDocs

Same as above, but accepts the passed in tie breaker

docIDs are expected to be in consistent pattern i.e. either all ScoreDocs have their shardIndex set, or all have them as -1 (signifying that all hits belong to same searcher)


fun merge(sort: Sort, topN: Int, shardHits: Array<TopFieldDocs>): TopFieldDocs

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.

See also

.merge


fun merge(sort: Sort, start: Int, topN: Int, shardHits: Array<TopFieldDocs>, tieBreaker: Comparator<ScoreDoc>): TopFieldDocs

Pass in a custom tie breaker for ordering results