MultiFieldQueryParser

A QueryParser which constructs queries to search multiple fields.

Constructors

Link copied to clipboard
constructor(fields: Array<String>, analyzer: Analyzer, boosts: Map<String, Float>)

Creates a MultiFieldQueryParser. Allows passing of a map with term to Boost, and the boost to apply to each term.

constructor(fields: Array<String>, analyzer: Analyzer)

Creates a MultiFieldQueryParser.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override var allowLeadingWildcard: Boolean

Set to true to allow leading wildcard characters.

Link copied to clipboard
Link copied to clipboard

Set to true if phrase queries will be automatically generated when the analyzer returns more than one term from whitespace delimited text. NOTE: this behavior may not be suitable for all languages.

Link copied to clipboard

Sets the default Resolution used for certain field when no Resolution is defined for this field.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Set to true to enable position increments in result query.

Link copied to clipboard
lateinit var field: String
Link copied to clipboard
open override var fuzzyMinSim: Float

Set the minimum similarity for fuzzy queries. Default is 2f.

Link copied to clipboard
open override var fuzzyPrefixLength: Int

Set the prefix length for fuzzy queries. Default is 0.

Link copied to clipboard
var jj_nt: Token?

Next token.

Link copied to clipboard
open override var locale: Locale

Returns current locale, allowing access by subclasses.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The actual operator that parser uses to combine query terms

Link copied to clipboard
open override var phraseSlop: Int

Sets the default slop for phrases. If zero, then exact phrase matches are required. Default value is zero.

Link copied to clipboard
open override var timeZone: TimeZone
Link copied to clipboard
var token: Token?

Current token.

Link copied to clipboard

Generated Token Manager.

Functions

Link copied to clipboard
fun Clause(field: String): Query?
Link copied to clipboard
Link copied to clipboard
fun createBooleanQuery(field: String, queryText: String, operator: BooleanClause.Occur): Query?
Link copied to clipboard
fun createMinShouldMatchQuery(field: String, queryText: String, fraction: Float): Query?
Link copied to clipboard
fun createPhraseQuery(field: String, queryText: String, phraseSlop: Int): Query?
Link copied to clipboard

Disable tracing.

Link copied to clipboard

Returns a String where the escape char has been removed, or kept only once if there was a double escape.

Link copied to clipboard

Enable tracing.

Link copied to clipboard

Generate ParseException.

Link copied to clipboard

Returns the date resolution that is used by RangeQueries for the given field. Returns null, if no default or field specific date resolution has been set for the given field.

Link copied to clipboard
Link copied to clipboard
fun getToken(index: Int): Token

Get the specific Token.

Link copied to clipboard
open fun handleBareFuzzy(qfield: String, fuzzySlop: Token, termImage: String): Query
Link copied to clipboard
fun handleBareTokenQuery(qfield: String, term: Token, fuzzySlop: Token?, prefix: Boolean, wildcard: Boolean, fuzzy: Boolean, regexp: Boolean): Query?
Link copied to clipboard
fun handleBoost(q: Query?, boost: Token?): Query?
Link copied to clipboard
fun handleQuotedTerm(qfield: String, term: Token, fuzzySlop: Token?): Query?
Link copied to clipboard
fun init(f: String, a: Analyzer)

Initializes a query parser. Called by the QueryParser constructor

Link copied to clipboard
fun Modifiers(): Int
Link copied to clipboard

Returns the first query if splitOnWhitespace=true or otherwise the entire produced query

Link copied to clipboard
open fun parse(query: String): Query?

Parses a query string, returning a Query.

Link copied to clipboard
fun Query(field: String): Query?
Link copied to clipboard
open override fun ReInit(stream: CharStream)

Reinitialise.

Link copied to clipboard
fun setDateResolution(fieldName: String, dateResolution: DateTools.Resolution)

Sets the date resolution used by RangeQueries for a specific field.

Link copied to clipboard

Sets the boolean operator of the QueryParser. In default mode (OR_OPERATOR) terms without any modifiers are considered optional: for example capital of Hungary is equal to capital OR of OR Hungary.

In AND_OPERATOR mode terms are considered to be in conjunction: the above-mentioned query is parsed as capital AND of AND Hungary

Link copied to clipboard
fun setSplitOnWhitespace(splitOnWhitespace: Boolean)

Whether query text should be split on whitespace prior to analysis. Default is {@value #DEFAULT_SPLIT_ON_WHITESPACE}.

Link copied to clipboard
fun Term(field: String): Query?
Link copied to clipboard
open override fun TopLevelQuery(field: String): Query?
Link copied to clipboard

Trace enabled.