QueryParserBase

This class is overridden by QueryParser in QueryParser.jj and acts to separate the majority of the Java code from the .jj grammar file.

Inheritors

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
open override var locale: Locale

Returns current locale, allowing access by subclasses.

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

Functions

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

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

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
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
open fun parse(query: String): Query?

Parses a query string, returning a Query.

Link copied to clipboard
abstract fun ReInit(stream: CharStream)
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
abstract fun TopLevelQuery(field: String): Query?