Apache Lucene.Net 2.1 Class Library API

QueryParser Members

QueryParser overview

Public Static Fields

AND_OPERATORAlternative form of QueryParser.Operator.AND
OR_OPERATORAlternative form of QueryParser.Operator.OR

Public Static Methods

Escape Returns a String where those characters that QueryParser expects to be escaped are escaped by a preceding
\
.
Main 

Public Instance Constructors

QueryParser Overloaded. Initializes a new instance of the QueryParser class.

Public Instance Fields

jj_nt 
lookingAhead 
token 
token_source 

Public Instance Methods

Clause 
Conjunction 
Disable_tracing 
Enable_tracing 
Equals (inherited from Object) Determines whether the specified Object is equal to the current Object.
GenerateParseException 
GetAllowLeadingWildcard 
GetAnalyzer 
GetDateResolution 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.
GetDefaultOperator Gets implicit operator setting, which will be either AND_OPERATOR or OR_OPERATOR.
GetField 
GetFuzzyMinSim Get the minimal similarity for fuzzy queries.
GetFuzzyPrefixLength Get the prefix length for fuzzy queries.
GetHashCode (inherited from Object) Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLocale Returns current locale, allowing access by subclasses.
GetLowercaseExpandedTerms 
GetNextToken 
GetPhraseSlop Gets the default slop for phrases.
GetToken 
GetType (inherited from Object) Gets the Type of the current instance.
GetUseOldRangeQuery 
Modifiers 
ParseParses a query string, returning a {@link Lucene.Net.Search.Query}.
Query 
ReInitOverloaded.  
SetAllowLeadingWildcard Set to
true
to allow
*
and
?
as the first character of a PrefixQuery and WildcardQuery. Note that this can produce very slow queries on big indexes. Default: false.
SetDateResolutionOverloaded. Sets the date resolution used by RangeQueries for a specific field.
SetDefaultOperator 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 conjuction: the above mentioned query is parsed as
capital AND of AND Hungary
SetFuzzyMinSim Set the minimum similarity for fuzzy queries. Default is 0.5f.
SetFuzzyPrefixLength Set the prefix length for fuzzy queries. Default is 0.
SetLocale Set locale used by date range parsing.
SetLowercaseExpandedTerms Whether terms of wildcard, prefix, fuzzy and range queries are to be automatically lower-cased or not. Default is
true
.
SetPhraseSlop Sets the default slop for phrases. If zero, then exact phrase matches are required. Default value is zero.
SetUseOldRangeQuery By default QueryParser uses new ConstantScoreRangeQuery in preference to RangeQuery for range queries. This implementation is generally preferable because it a) Runs faster b) Does not have the scarcity of range terms unduly influence score c) avoids any "TooManyBooleanClauses" exception. However, if your application really needs to use the old-fashioned RangeQuery and the above points are not required then set this option to
true
Default is
false
.
Term 
ToString (inherited from Object) Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

Protected Internal Instance Methods

AddClause 
GetBooleanQueryOverloaded. 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.
GetFieldQueryOverloaded. Base implementation delegates to {@link #GetFieldQuery(String,String)}. This method may be overridden, for example, to return a SpanNearQuery instead of a PhraseQuery.
GetFuzzyQuery Factory method for generating a query (similar to {@link #getWildcardQuery}). Called when parser parses an input term token that has the fuzzy suffix (~) appended.
GetPrefixQuery 
GetRangeQuery 
GetWildcardQuery 

See Also

QueryParser Class | Lucene.Net.QueryParsers Namespace