MultiPhraseQuery

A generalized version of PhraseQuery, with the possibility of adding more than one term at the same position that are treated as a disjunction (OR). To use this class to search for the phrase "Microsoft app*" first create a Builder and use Builder.add on the term "microsoft" (assuming lowercase analysis), then find all terms that have "app" as prefix using LeafReader.terms, seeking to "app" then iterating and collecting terms until there is no longer that prefix, and finally use Builder.add to add them. returns the fully constructed (and immutable) MultiPhraseQuery.

Types

Link copied to clipboard
class Builder

A builder for multi-phrase queries

Link copied to clipboard
Link copied to clipboard

Slower version of UnionPostingsEnum that delegates offsets and positions, for use by MatchesIterator

Link copied to clipboard

Takes the logical union of multiple PostingsEnum iterators.

Properties

Link copied to clipboard

Returns the relative positions of terms in this phrase. Do not modify!

Link copied to clipboard
val slop: Int

Sets the phrase slop for this query.

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 if o is equal to this.

Link copied to clipboard

Returns the arrays of arrays of terms in the multi-phrase. Do not modify!

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

Returns a hash code value for this object.

Link copied to clipboard
open override 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(f: String?): String

Prints a user-readable version of this query.

open override fun toString(): String

Prints a query to a string.

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

Recurse through the query tree, visiting any child queries.