TopFieldCollector

A Collector that sorts by SortField using FieldComparators.

See the constructor of TopFieldCollectorManager for instantiating a TopFieldCollectorManager with support for concurrency in IndexSearcher.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The total number of documents that the collector encountered.

Link copied to clipboard
Link copied to clipboard
abstract var weight: Weight?

Set the Weight that will be used to produce scorers that will feed [ ]s. This is typically useful to have access to Weight.count from .

Functions

Link copied to clipboard
fun add(slot: Int, doc: Int)
Link copied to clipboard

Create a new collector to collect the given context.

Link copied to clipboard
open override fun scoreMode(): ScoreMode

Indicates what features are required from the scorer.

Link copied to clipboard
fun topDocs(start: Int): TopDocs

Returns the documents in the range [start .. pq.size()) that were collected by this collector. Note that if start >= pq.size(), an empty TopDocs is returned.

This method is convenient to call if the application always asks for the last results, starting from the last 'page'.

NOTE: you cannot call this method more than once for each search execution. If you need to call it more than once, passing each time a different start, you should call .topDocs and work with the returned TopDocs object, which will contain all the results this search execution collected.

fun topDocs(start: Int, howMany: Int): TopDocs

Returns the documents in the range [start .. start+howMany) that were collected by this collector. Note that if start >= pq.size(), an empty TopDocs is returned, and if pq.size() - start < howMany, then only the available documents in [start .. pq.size()) are returned.

This method is useful to call in case pagination of search results is allowed by the search application, as well as it attempts to optimize the memory used by allocating only as much as requested by howMany.

NOTE: you cannot call this method more than once for each search execution. If you need to call it more than once, passing each time a different range, you should call .topDocs and work with the returned TopDocs object, which will contain all the results this search execution collected.

open override fun topDocs(): TopFieldDocs

Returns the top docs that were collected by this collector.

Link copied to clipboard
fun updateBottom(doc: Int)