Class QueryParser
This class is generated by JavaCC. The only method that clients should need
to call is Parse(String).
This parser generates queries that make use of position information
(Span queries). It provides positional operators (w
and
n
) that accept a numeric distance, as well as boolean
operators (and
, or
, and not
,
wildcards (///
and ?
), quoting (with
"
), and boosting (via ^
).
The operators (W, N, AND, OR, NOT) can be expressed lower-cased or
upper-cased, and the non-unary operators (everything but NOT) support
both infix (a AND b AND c)
and prefix AND(a, b,
c)
notation.
The W and N operators express a positional relationship among their
operands. N is ordered, and W is unordered. The distance is 1 by
default, meaning the operands are adjacent, or may be provided as a
prefix from 2-99. So, for example, 3W(a, b) means that terms a and b
must appear within three positions of each other, or in other words, up
to two terms may appear between a and b.
Inheritance
System.Object
QueryParser
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Lucene.Net.QueryParser.dll
Syntax
Constructors
|
Improve this Doc
View Source
QueryParser()
Declaration
|
Improve this Doc
View Source
QueryParser(ICharStream)
Declaration
public QueryParser(ICharStream stream)
Parameters
|
Improve this Doc
View Source
QueryParser(QueryParserTokenManager)
Constructor with generated Token Manager.
Declaration
public QueryParser(QueryParserTokenManager tm)
Parameters
Properties
|
Improve this Doc
View Source
Jj_nt
Declaration
public Token Jj_nt { get; set; }
Property Value
|
Improve this Doc
View Source
Token
Declaration
public Token Token { get; set; }
Property Value
|
Improve this Doc
View Source
TokenSource
Declaration
public QueryParserTokenManager TokenSource { get; set; }
Property Value
Methods
|
Improve this Doc
View Source
AllowedSuffix(String)
Declaration
protected virtual bool AllowedSuffix(string suffixed)
Parameters
Type |
Name |
Description |
System.String |
suffixed |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
AllowedTruncation(String)
Declaration
protected virtual bool AllowedTruncation(string truncated)
Parameters
Type |
Name |
Description |
System.String |
truncated |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
AndQuery()
Declaration
public SrndQuery AndQuery()
Returns
|
Improve this Doc
View Source
CheckDistanceSubQueries(DistanceQuery, String)
Declaration
protected static void CheckDistanceSubQueries(DistanceQuery distq, string opName)
Parameters
|
Improve this Doc
View Source
Disable_tracing()
Declaration
public void Disable_tracing()
|
Improve this Doc
View Source
Enable_tracing()
Declaration
public void Enable_tracing()
|
Improve this Doc
View Source
FieldsQuery()
Declaration
public SrndQuery FieldsQuery()
Returns
|
Improve this Doc
View Source
FieldsQueryList()
Declaration
public IList<SrndQuery> FieldsQueryList()
Returns
Type |
Description |
System.Collections.Generic.IList<SrndQuery> |
|
|
Improve this Doc
View Source
GenerateParseException()
Declaration
public virtual ParseException GenerateParseException()
Returns
|
Improve this Doc
View Source
GetAndQuery(IList<SrndQuery>, Boolean, Token)
Declaration
protected virtual SrndQuery GetAndQuery(IList<SrndQuery> queries, bool infix, Token andToken)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IList<SrndQuery> |
queries |
|
System.Boolean |
infix |
|
Token |
andToken |
|
Returns
|
Improve this Doc
View Source
GetDistanceQuery(IList<SrndQuery>, Boolean, Token, Boolean)
Declaration
protected virtual SrndQuery GetDistanceQuery(IList<SrndQuery> queries, bool infix, Token dToken, bool ordered)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IList<SrndQuery> |
queries |
|
System.Boolean |
infix |
|
Token |
dToken |
|
System.Boolean |
ordered |
|
Returns
|
Improve this Doc
View Source
GetFieldsQuery(SrndQuery, IList<String>)
Declaration
protected virtual SrndQuery GetFieldsQuery(SrndQuery q, IList<string> fieldNames)
Parameters
Type |
Name |
Description |
SrndQuery |
q |
|
System.Collections.Generic.IList<System.String> |
fieldNames |
|
Returns
|
Improve this Doc
View Source
GetNextToken()
Declaration
public Token GetNextToken()
Returns
|
Improve this Doc
View Source
GetNotQuery(IList<SrndQuery>, Token)
Declaration
protected virtual SrndQuery GetNotQuery(IList<SrndQuery> queries, Token notToken)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IList<SrndQuery> |
queries |
|
Token |
notToken |
|
Returns
|
Improve this Doc
View Source
GetOpDistance(String)
Declaration
protected static int GetOpDistance(string distanceOp)
Parameters
Type |
Name |
Description |
System.String |
distanceOp |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
GetOrQuery(IList<SrndQuery>, Boolean, Token)
Declaration
protected virtual SrndQuery GetOrQuery(IList<SrndQuery> queries, bool infix, Token orToken)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IList<SrndQuery> |
queries |
|
System.Boolean |
infix |
|
Token |
orToken |
|
Returns
|
Improve this Doc
View Source
GetPrefixQuery(String, Boolean)
Declaration
protected virtual SrndQuery GetPrefixQuery(string prefix, bool quoted)
Parameters
Type |
Name |
Description |
System.String |
prefix |
|
System.Boolean |
quoted |
|
Returns
|
Improve this Doc
View Source
GetTermQuery(String, Boolean)
Declaration
protected virtual SrndQuery GetTermQuery(string term, bool quoted)
Parameters
Type |
Name |
Description |
System.String |
term |
|
System.Boolean |
quoted |
|
Returns
|
Improve this Doc
View Source
GetToken(Int32)
Declaration
public Token GetToken(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
|
Improve this Doc
View Source
GetTruncQuery(String)
Declaration
protected virtual SrndQuery GetTruncQuery(string truncated)
Parameters
Type |
Name |
Description |
System.String |
truncated |
|
Returns
|
Improve this Doc
View Source
NotQuery()
Declaration
public SrndQuery NotQuery()
Returns
|
Improve this Doc
View Source
NQuery()
Declaration
public SrndQuery NQuery()
Returns
|
Improve this Doc
View Source
OptionalFields()
Declaration
public IList<string> OptionalFields()
Returns
Type |
Description |
System.Collections.Generic.IList<System.String> |
|
|
Improve this Doc
View Source
OptionalWeights(SrndQuery)
Declaration
public void OptionalWeights(SrndQuery q)
Parameters
|
Improve this Doc
View Source
OrQuery()
Declaration
public SrndQuery OrQuery()
Returns
|
Improve this Doc
View Source
Parse(String)
Declaration
public static SrndQuery Parse(string query)
Parameters
Type |
Name |
Description |
System.String |
query |
|
Returns
|
Improve this Doc
View Source
Parse2(String)
Declaration
public virtual SrndQuery Parse2(string query)
Parameters
Type |
Name |
Description |
System.String |
query |
|
Returns
|
Improve this Doc
View Source
PrefixOperatorQuery()
Declaration
public SrndQuery PrefixOperatorQuery()
Returns
|
Improve this Doc
View Source
PrimaryQuery()
Declaration
public SrndQuery PrimaryQuery()
Returns
|
Improve this Doc
View Source
ReInit(ICharStream)
Declaration
public virtual void ReInit(ICharStream stream)
Parameters
|
Improve this Doc
View Source
ReInit(QueryParserTokenManager)
Declaration
public virtual void ReInit(QueryParserTokenManager tm)
Parameters
|
Improve this Doc
View Source
SimpleTerm()
Declaration
public SrndQuery SimpleTerm()
Returns
|
Improve this Doc
View Source
TopSrndQuery()
Declaration
public SrndQuery TopSrndQuery()
Returns
|
Improve this Doc
View Source
WQuery()
Declaration
public SrndQuery WQuery()
Returns