BlendedTermQuery

A Query that blends index statistics across multiple terms. This is particularly useful when several terms should produce identical scores, regardless of their index statistics.

For instance imagine that you are resolving synonyms at search time, all terms should produce identical scores instead of the default behavior, which tends to give higher scores to rare terms.

An other useful use-case is cross-field search: imagine that you would like to search for john on two fields: first_name and last_name. You might not want to give a higher weight to matches on the field where john is rarer, in which case [ ] would help as well.

Types

Link copied to clipboard
class Builder

A Builder for BlendedTermQuery.

Link copied to clipboard
object Companion
Link copied to clipboard

A RewriteMethod that creates a DisjunctionMaxQuery out of the sub queries. This RewriteMethod is useful when having a good match on a single field is considered better than having average matches on several fields.

Link copied to clipboard
abstract class RewriteMethod

A RewriteMethod defines how queries for individual terms should be merged.

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.