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.

Afficher le fichier Open project: apache/lucenenet Class Usage Examples

Méthodes publiques

Свойство Type Description
jj_nt Token
token Token
token_source QueryParserTokenManager

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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

Méthode 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 méthode

protected AllowedSuffix ( string suffixed ) : bool
suffixed string
Résultat bool

AllowedTruncation() protected méthode

protected AllowedTruncation ( string truncated ) : bool
truncated string
Résultat bool

AndQuery() public méthode

public AndQuery ( ) : SrndQuery
Résultat Lucene.Net.QueryParsers.Surround.Query.SrndQuery

CheckDistanceSubQueries() protected static méthode

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

Disable_tracing() public méthode

Disable tracing.
public Disable_tracing ( ) : void
Résultat void

Enable_tracing() public méthode

Enable tracing.
public Enable_tracing ( ) : void
Résultat void

FieldsQuery() public méthode

public FieldsQuery ( ) : SrndQuery
Résultat Lucene.Net.QueryParsers.Surround.Query.SrndQuery

FieldsQueryList() public méthode

public FieldsQueryList ( ) : IEnumerable
Résultat IEnumerable

GenerateParseException() public méthode

Generate ParseException.
public GenerateParseException ( ) : ParseException
Résultat ParseException

GetAndQuery() protected méthode

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

GetDistanceQuery() protected méthode

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

GetFieldsQuery() protected méthode

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

GetNextToken() public méthode

Get the next Token.
public GetNextToken ( ) : Token
Résultat Token

GetNotQuery() protected méthode

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

GetOpDistance() protected static méthode

protected static GetOpDistance ( string distanceOp ) : int
distanceOp string
Résultat int

GetOrQuery() protected méthode

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

GetPrefixQuery() protected méthode

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

GetTermQuery() protected méthode

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

GetToken() public méthode

Get the specific Token.
public GetToken ( int index ) : Token
index int
Résultat Token

GetTruncQuery() protected méthode

protected GetTruncQuery ( string truncated ) : SrndQuery
truncated string
Résultat Lucene.Net.QueryParsers.Surround.Query.SrndQuery

NQuery() public méthode

public NQuery ( ) : SrndQuery
Résultat Lucene.Net.QueryParsers.Surround.Query.SrndQuery

NotQuery() public méthode

public NotQuery ( ) : SrndQuery
Résultat Lucene.Net.QueryParsers.Surround.Query.SrndQuery

OptionalFields() public méthode

public OptionalFields ( ) : IEnumerable
Résultat IEnumerable

OptionalWeights() public méthode

public OptionalWeights ( SrndQuery q ) : void
q Lucene.Net.QueryParsers.Surround.Query.SrndQuery
Résultat void

OrQuery() public méthode

public OrQuery ( ) : SrndQuery
Résultat Lucene.Net.QueryParsers.Surround.Query.SrndQuery

Parse() public static méthode

public static Parse ( string query ) : SrndQuery
query string
Résultat Lucene.Net.QueryParsers.Surround.Query.SrndQuery

Parse2() public méthode

public Parse2 ( string query ) : SrndQuery
query string
Résultat Lucene.Net.QueryParsers.Surround.Query.SrndQuery

PrefixOperatorQuery() public méthode

public PrefixOperatorQuery ( ) : SrndQuery
Résultat Lucene.Net.QueryParsers.Surround.Query.SrndQuery

PrimaryQuery() public méthode

public PrimaryQuery ( ) : SrndQuery
Résultat Lucene.Net.QueryParsers.Surround.Query.SrndQuery

QueryParser() public méthode

public QueryParser ( ) : Lucene.Net.QueryParsers.Surround.Query
Résultat Lucene.Net.QueryParsers.Surround.Query

QueryParser() public méthode

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

QueryParser() public méthode

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

ReInit() public méthode

Reinitialize.
public ReInit ( ICharStream stream ) : void
stream ICharStream
Résultat void

ReInit() public méthode

Reinitialize.
public ReInit ( QueryParserTokenManager tm ) : void
tm QueryParserTokenManager
Résultat void

SimpleTerm() public méthode

public SimpleTerm ( ) : SrndQuery
Résultat Lucene.Net.QueryParsers.Surround.Query.SrndQuery

TopSrndQuery() public méthode

public TopSrndQuery ( ) : SrndQuery
Résultat Lucene.Net.QueryParsers.Surround.Query.SrndQuery

WQuery() public méthode

public WQuery ( ) : SrndQuery
Résultat Lucene.Net.QueryParsers.Surround.Query.SrndQuery

Property Details

jj_nt public_oe property

Next token.
public Token,Lucene.Net.QueryParsers.Surround.Parser jj_nt
Résultat Token

token public_oe property

Current token.
public Token,Lucene.Net.QueryParsers.Surround.Parser token
Résultat Token

token_source public_oe property

Generated Token Manager.
public QueryParserTokenManager,Lucene.Net.QueryParsers.Surround.Parser token_source
Résultat QueryParserTokenManager