C# Class Lucene.Net.QueryParsers.Surround.Parser.QueryParser

This class is generated by JavaCC. The only method that clients should need to call is {@link #parse parse()}.

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.

Datei anzeigen Open project: apache/lucenenet Class Usage Examples

Public Properties

Property Type Description
jj_nt Token
token Token
token_source QueryParserTokenManager

Public Methods

Method Description
AndQuery ( ) : SrndQuery
Disable_tracing ( ) : void

Disable tracing.

Enable_tracing ( ) : void

Enable tracing.

FieldsQuery ( ) : SrndQuery
FieldsQueryList ( ) : IEnumerable
GenerateParseException ( ) : ParseException

Generate ParseException.

GetNextToken ( ) : Token

Get the next Token.

GetToken ( int index ) : Token

Get the specific Token.

NQuery ( ) : SrndQuery
NotQuery ( ) : SrndQuery
OptionalFields ( ) : IEnumerable
OptionalWeights ( SrndQuery q ) : void
OrQuery ( ) : SrndQuery
Parse ( string query ) : SrndQuery
Parse2 ( string query ) : SrndQuery
PrefixOperatorQuery ( ) : SrndQuery
PrimaryQuery ( ) : SrndQuery
QueryParser ( ) : Lucene.Net.QueryParsers.Surround.Query
QueryParser ( ICharStream stream ) : Lucene.Net.QueryParsers.Surround.Query

Constructor with user supplied ICharStream.

QueryParser ( QueryParserTokenManager tm ) : Lucene.Net.QueryParsers.Surround.Query

Constructor with generated Token Manager.

ReInit ( ICharStream stream ) : void

Reinitialize.

ReInit ( QueryParserTokenManager tm ) : void

Reinitialize.

SimpleTerm ( ) : SrndQuery
TopSrndQuery ( ) : SrndQuery
WQuery ( ) : SrndQuery

Protected Methods

Method Description
AllowedSuffix ( string suffixed ) : bool
AllowedTruncation ( string truncated ) : bool
CheckDistanceSubQueries ( DistanceQuery distq, string opName ) : void
GetAndQuery ( IEnumerable queries, bool infix, Token andToken ) : SrndQuery
GetDistanceQuery ( IEnumerable queries, bool infix, Token dToken, bool ordered ) : SrndQuery
GetFieldsQuery ( SrndQuery q, IEnumerable fieldNames ) : SrndQuery
GetNotQuery ( IEnumerable queries, Token notToken ) : SrndQuery
GetOpDistance ( string distanceOp ) : int
GetOrQuery ( IEnumerable queries, bool infix, Token orToken ) : SrndQuery
GetPrefixQuery ( string prefix, bool quoted ) : SrndQuery
GetTermQuery ( string term, bool quoted ) : SrndQuery
GetTruncQuery ( string truncated ) : SrndQuery

Private Methods

Method Description
Jj_2_1 ( int xla ) : bool
Jj_3_1 ( ) : bool
Jj_add_error_token ( int kind, int pos ) : void
Jj_consume_token ( int kind ) : Token
Jj_la1_init_0 ( ) : void
Jj_ntk ( ) : int
Jj_rescan_token ( ) : void
Jj_save ( int index, int xla ) : void
Jj_scan_token ( int kind ) : bool

Method Details

AllowedSuffix() protected method

protected AllowedSuffix ( string suffixed ) : bool
suffixed string
return bool

AllowedTruncation() protected method

protected AllowedTruncation ( string truncated ) : bool
truncated string
return bool

AndQuery() public method

public AndQuery ( ) : SrndQuery
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

CheckDistanceSubQueries() protected static method

protected static CheckDistanceSubQueries ( DistanceQuery distq, string opName ) : void
distq Lucene.Net.QueryParsers.Surround.Query.DistanceQuery
opName string
return void

Disable_tracing() public method

Disable tracing.
public Disable_tracing ( ) : void
return void

Enable_tracing() public method

Enable tracing.
public Enable_tracing ( ) : void
return void

FieldsQuery() public method

public FieldsQuery ( ) : SrndQuery
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

FieldsQueryList() public method

public FieldsQueryList ( ) : IEnumerable
return IEnumerable

GenerateParseException() public method

Generate ParseException.
public GenerateParseException ( ) : ParseException
return ParseException

GetAndQuery() protected method

protected GetAndQuery ( IEnumerable queries, bool infix, Token andToken ) : SrndQuery
queries IEnumerable
infix bool
andToken Token
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

GetDistanceQuery() protected method

protected GetDistanceQuery ( IEnumerable queries, bool infix, Token dToken, bool ordered ) : SrndQuery
queries IEnumerable
infix bool
dToken Token
ordered bool
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

GetFieldsQuery() protected method

protected GetFieldsQuery ( SrndQuery q, IEnumerable fieldNames ) : SrndQuery
q Lucene.Net.QueryParsers.Surround.Query.SrndQuery
fieldNames IEnumerable
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

GetNextToken() public method

Get the next Token.
public GetNextToken ( ) : Token
return Token

GetNotQuery() protected method

protected GetNotQuery ( IEnumerable queries, Token notToken ) : SrndQuery
queries IEnumerable
notToken Token
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

GetOpDistance() protected static method

protected static GetOpDistance ( string distanceOp ) : int
distanceOp string
return int

GetOrQuery() protected method

protected GetOrQuery ( IEnumerable queries, bool infix, Token orToken ) : SrndQuery
queries IEnumerable
infix bool
orToken Token
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

GetPrefixQuery() protected method

protected GetPrefixQuery ( string prefix, bool quoted ) : SrndQuery
prefix string
quoted bool
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

GetTermQuery() protected method

protected GetTermQuery ( string term, bool quoted ) : SrndQuery
term string
quoted bool
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

GetToken() public method

Get the specific Token.
public GetToken ( int index ) : Token
index int
return Token

GetTruncQuery() protected method

protected GetTruncQuery ( string truncated ) : SrndQuery
truncated string
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

NQuery() public method

public NQuery ( ) : SrndQuery
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

NotQuery() public method

public NotQuery ( ) : SrndQuery
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

OptionalFields() public method

public OptionalFields ( ) : IEnumerable
return IEnumerable

OptionalWeights() public method

public OptionalWeights ( SrndQuery q ) : void
q Lucene.Net.QueryParsers.Surround.Query.SrndQuery
return void

OrQuery() public method

public OrQuery ( ) : SrndQuery
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

Parse() public static method

public static Parse ( string query ) : SrndQuery
query string
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

Parse2() public method

public Parse2 ( string query ) : SrndQuery
query string
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

PrefixOperatorQuery() public method

public PrefixOperatorQuery ( ) : SrndQuery
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

PrimaryQuery() public method

public PrimaryQuery ( ) : SrndQuery
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

QueryParser() public method

public QueryParser ( ) : Lucene.Net.QueryParsers.Surround.Query
return Lucene.Net.QueryParsers.Surround.Query

QueryParser() public method

Constructor with user supplied ICharStream.
public QueryParser ( ICharStream stream ) : Lucene.Net.QueryParsers.Surround.Query
stream ICharStream
return Lucene.Net.QueryParsers.Surround.Query

QueryParser() public method

Constructor with generated Token Manager.
public QueryParser ( QueryParserTokenManager tm ) : Lucene.Net.QueryParsers.Surround.Query
tm QueryParserTokenManager
return Lucene.Net.QueryParsers.Surround.Query

ReInit() public method

Reinitialize.
public ReInit ( ICharStream stream ) : void
stream ICharStream
return void

ReInit() public method

Reinitialize.
public ReInit ( QueryParserTokenManager tm ) : void
tm QueryParserTokenManager
return void

SimpleTerm() public method

public SimpleTerm ( ) : SrndQuery
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

TopSrndQuery() public method

public TopSrndQuery ( ) : SrndQuery
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

WQuery() public method

public WQuery ( ) : SrndQuery
return Lucene.Net.QueryParsers.Surround.Query.SrndQuery

Property Details

jj_nt public_oe property

Next token.
public Token,Lucene.Net.QueryParsers.Surround.Parser jj_nt
return Token

token public_oe property

Current token.
public Token,Lucene.Net.QueryParsers.Surround.Parser token
return Token

token_source public_oe property

Generated Token Manager.
public QueryParserTokenManager,Lucene.Net.QueryParsers.Surround.Parser token_source
return QueryParserTokenManager