build

fun build(indexSearcher: IndexSearcher, term: Term, needsStats: Boolean): TermStates

Creates a TermStates from a top-level IndexReaderContext and the given [ ]. This method will lookup the given term in all context's leaf readers and register each of the readers containing the term in the returned TermStates using the leaf reader's ordinal.

Note: the given context must be a top-level context.

Parameters

needsStats

if true then all leaf contexts will be visited up-front to collect term statistics. Otherwise, the TermState objects will be built only when requested