TermQuery

open class TermQuery : Query

A Query that matches documents containing a term. This may be combined with other terms with a BooleanQuery.

Constructors

Link copied to clipboard
constructor(t: Term)

Constructs a query for the term t.

constructor(t: Term, states: TermStates)

Expert: constructs a TermQuery that will use the provided docFreq instead of looking up the docFreq against the searcher.

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun createWeight(searcher: IndexSearcher, scoreMode: ScoreMode, boost: Float): Weight

Expert: Constructs an appropriate Weight implementation for this query.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Returns true iff other is equal to this.

Link copied to clipboard
fun getTerm(): Term

Returns the term of this query.

Link copied to clipboard
open override fun hashCode(): Int

Override and implement query hash code properly in a subclass. This is required so that [ ] works properly.

Link copied to clipboard
open fun rewrite(indexSearcher: IndexSearcher): Query

Expert: called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.

Link copied to clipboard
open override fun toString(): String

Prints a query to a string.

open override fun toString(field: String?): String

Prints a user-readable version of this query.

Link copied to clipboard
open override fun visit(visitor: QueryVisitor)

Recurse through the query tree, visiting any child queries.