NGramPhraseQuery

class NGramPhraseQuery(val n: Int, phraseQuery: PhraseQuery) : Query

This is a PhraseQuery which is optimized for n-gram phrase query. For example, when you query "ABCD" on a 2-gram field, you may want to use NGramPhraseQuery rather than PhraseQuery, because NGramPhraseQuery will Query.rewrite the query to "AB/0 CD/2", while PhraseQuery will query "AB/0 BC/1 CD/2" (where term/position).

Constructors

Link copied to clipboard
constructor(n: Int, phraseQuery: PhraseQuery)

Properties

Link copied to clipboard
val n: Int

Return the n in n-gram

Link copied to clipboard

Return the list of relative positions that each term should appear at.

Link copied to clipboard

Return the list of terms.

Functions

Link copied to clipboard
open 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

Override and implement query instance equivalence properly in a subclass. This is required so that QueryCache works properly.

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 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(field: String?): String

Prints a query to a string, with field assumed to be the default field and omitted.

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.