Class QueryParserBase
This class is overridden by QueryParser.
Inherited Members
Assembly: Lucene.Net.QueryParser.dll
Syntax
[Serializable]
public abstract class QueryParserBase : QueryBuilder, ICommonQueryParserConfiguration
Constructors
Name | Description |
---|---|
QueryParserBase() | So the generated QueryParser(CharStream) won't error out |
Fields
Name | Description |
---|---|
AND_OPERATOR | Alternative form of AND |
CONJ_AND | |
CONJ_NONE | |
CONJ_OR | |
m_field | |
MOD_NONE | |
MOD_NOT | |
MOD_REQ | |
OR_OPERATOR | Alternative form of OR |
Properties
Name | Description |
---|---|
AllowLeadingWildcard | Set to
When set, Default: false. |
AnalyzeRangeTerms | Get or Set whether or not to analyze range terms when constructing TermRangeQuerys. For example, setting this to true can enable analyzing terms into collation keys for locale-sensitive TermRangeQuery. |
AutoGeneratePhraseQueries | 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. Set to false if phrase queries should only be generated when surrounded by double quotes. |
DefaultOperator | Gets or Sets the boolean operator of the QueryParser.
In default mode (OR_OPERATOR) terms without any modifiers
are considered optional: for example
In AND_OPERATOR mode terms are considered to be in conjunction: the
above mentioned query is parsed as |
Field | Returns the default field. |
FuzzyMinSim | Get or Set the minimum similarity for fuzzy queries. Default is 2f. |
FuzzyPrefixLength | Get or Set the prefix length for fuzzy queries. Default is 0. |
Locale | Get or Set locale used by date range parsing, lowercasing, and other locale-sensitive operations.
By default, the culture is |
LowercaseExpandedTerms | Whether terms of wildcard, prefix, fuzzy and range queries are to be automatically
lower-cased or not. Default is |
MultiTermRewriteMethod | By default QueryParser uses CONSTANT_SCORE_AUTO_REWRITE_DEFAULT when creating a PrefixQuery, WildcardQuery or TermRangeQuery. This implementation is generally preferable because it a) Runs faster b) Does not have the scarcity of terms unduly influence score c) avoids any BooleanQuery.TooManyClausesException exception. However, if your application really needs to use the old-fashioned BooleanQuery expansion rewriting and the above points are not relevant then use this to change the rewrite method. |
PhraseSlop | Gets or Sets the default slop for phrases. If zero, then exact phrase matches are required. Default value is zero. |
TimeZone | Get or Set the current time zone for date and time parsing operations.
By default, the time zone is |
Methods
Name | Description |
---|---|
AddClause(IList<BooleanClause>, Int32, Int32, Query) | |
AnalyzeMultitermTerm(String, String, Analyzer) | |
Escape(String) | Returns a string where those characters that QueryParser expects to be escaped are escaped by a preceding .
|
GetBooleanQuery(IList<BooleanClause>) | Factory method for generating query, given a set of clauses. By default creates a boolean query composed of clauses passed in. Can be overridden by extending classes, to modify query being returned. |
GetBooleanQuery(IList<BooleanClause>, Boolean) | Factory method for generating query, given a set of clauses. By default creates a boolean query composed of clauses passed in. Can be overridden by extending classes, to modify query being returned. |
GetDateResolution(String) | 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. |
GetFieldQuery(String, String, Boolean) | |
GetFieldQuery(String, String, Int32) | Base implementation delegates to GetFieldQuery(String, String, Boolean). This method may be overridden, for example, to return a SpanNearQuery instead of a PhraseQuery. |
GetFuzzyQuery(String, String, Single) | Factory method for generating a query (similar to GetWildcardQuery(String, String)). Called when parser parses an input term token that has the fuzzy suffix (~) appended. |
GetPrefixQuery(String, String) | Factory method for generating a query (similar to GetWildcardQuery(String, String)). Called when parser parses an input term token that uses prefix notation; that is, contains a single '*' wildcard character as its last character. Since this is a special case of generic wildcard term, and such a query can be optimized easily, this usually results in a different query object. Depending on settings, a prefix term may be lower-cased automatically. It will not go through the default Analyzer, however, since normal Analyzers are unlikely to work properly with wildcard templates. Can be overridden by extending classes, to provide custom handling for wild card queries, which may be necessary due to missing analyzer calls. |
GetRangeQuery(String, String, String, Boolean, Boolean) | |
GetRegexpQuery(String, String) | Factory method for generating a query. Called when parser parses an input term token that contains a regular expression query. Depending on settings, pattern term may be lower-cased automatically. It will not go through the default Analyzer, however, since normal Analyzers are unlikely to work properly with regular expression templates. Can be overridden by extending classes, to provide custom handling for regular expression queries, which may be necessary due to missing analyzer calls. |
GetWildcardQuery(String, String) | Factory method for generating a query. Called when parser parses an input term token that contains one or more wildcard characters (? and *), but is not a prefix term token (one that has just a single * character at the end) Depending on settings, prefix term may be lower-cased automatically. It will not go through the default Analyzer, however, since normal Analyzers are unlikely to work properly with wildcard templates. Can be overridden by extending classes, to provide custom handling for wildcard queries, which may be necessary due to missing analyzer calls. |
Init(LuceneVersion, String, Analyzer) | Initializes a query parser. Called by the QueryParser constructor |
NewBooleanClause(Query, Occur) | Builds a new BooleanClause instance |
NewFieldQuery(Analyzer, String, String, Boolean) | |
NewFuzzyQuery(Term, Single, Int32) | Builds a new FuzzyQuery instance |
NewMatchAllDocsQuery() | Builds a new MatchAllDocsQuery instance |
NewPrefixQuery(Term) | Builds a new PrefixQuery instance |
NewRangeQuery(String, String, String, Boolean, Boolean) | Builds a new TermRangeQuery instance |
NewRegexpQuery(Term) | Builds a new RegexpQuery instance |
NewWildcardQuery(Term) | Builds a new WildcardQuery instance |
Parse(String) | Parses a query string, returning a Query. |
ReInit(ICharStream) | |
SetDateResolution(DateTools.Resolution) | Gets or Sets the default date resolution used by RangeQueries for fields for which no specific date resolutions has been set. Field specific resolutions can be set with SetDateResolution(String, DateTools.Resolution). |
SetDateResolution(String, DateTools.Resolution) | Sets the date resolution used by RangeQueries for a specific field. |
TopLevelQuery(String) |