C# Class Lucene.Net.QueryParsers.ComplexPhrase.ComplexPhraseQueryParser

QueryParser which permits complex phrase query syntax eg "(john jon jonathan~) peters*".

Performs potentially multiple passes over Query text to parse any nested logic in PhraseQueries. - First pass takes any PhraseQuery content between quotes and stores for subsequent pass. All other query content is parsed as normal - Second pass parses any stored PhraseQuery content, checking all embedded clauses are referring to the same field and therefore can be rewritten as Span queries. All PhraseQuery clauses are expressed as ComplexPhraseQuery objects

This could arguably be done in one pass using a new QueryParser but here I am working within the constraints of the existing parser as a base class. This currently simply feeds all phrase content through an analyzer to select phrase terms - any "special" syntax such as * ~ * etc are not given special status

Inheritance: Classic.QueryParser
Afficher le fichier Open project: apache/lucenenet Class Usage Examples

Méthodes publiques

Méthode Description
ComplexPhraseQueryParser ( LuceneVersion matchVersion, string f, Analyzer a ) : Lucene.Net.Analysis
Parse ( string query ) : Query

Méthodes protégées

Méthode Description
GetFieldQuery ( string field, string queryText, int slop ) : Query
GetFuzzyQuery ( string field, string termStr, float minSimilarity ) : Query
GetRangeQuery ( string field, string part1, string part2, bool startInclusive, bool endInclusive ) : Query
GetWildcardQuery ( string field, string termStr ) : Query
NewRangeQuery ( string field, string part1, string part2, bool startInclusive, bool endInclusive ) : Query
NewTermQuery ( Lucene.Net.Index.Term term ) : Query

Private Methods

Méthode Description
CheckPhraseClauseIsForSameField ( string field ) : void

Method Details

ComplexPhraseQueryParser() public méthode

public ComplexPhraseQueryParser ( LuceneVersion matchVersion, string f, Analyzer a ) : Lucene.Net.Analysis
matchVersion LuceneVersion
f string
a Lucene.Net.Analysis.Analyzer
Résultat Lucene.Net.Analysis

GetFieldQuery() protected méthode

protected GetFieldQuery ( string field, string queryText, int slop ) : Query
field string
queryText string
slop int
Résultat Lucene.Net.Search.Query

GetFuzzyQuery() protected méthode

protected GetFuzzyQuery ( string field, string termStr, float minSimilarity ) : Query
field string
termStr string
minSimilarity float
Résultat Lucene.Net.Search.Query

GetRangeQuery() protected méthode

protected GetRangeQuery ( string field, string part1, string part2, bool startInclusive, bool endInclusive ) : Query
field string
part1 string
part2 string
startInclusive bool
endInclusive bool
Résultat Lucene.Net.Search.Query

GetWildcardQuery() protected méthode

protected GetWildcardQuery ( string field, string termStr ) : Query
field string
termStr string
Résultat Lucene.Net.Search.Query

NewRangeQuery() protected méthode

protected NewRangeQuery ( string field, string part1, string part2, bool startInclusive, bool endInclusive ) : Query
field string
part1 string
part2 string
startInclusive bool
endInclusive bool
Résultat Lucene.Net.Search.Query

NewTermQuery() protected méthode

protected NewTermQuery ( Lucene.Net.Index.Term term ) : Query
term Lucene.Net.Index.Term
Résultat Lucene.Net.Search.Query

Parse() public méthode

public Parse ( string query ) : Query
query string
Résultat Lucene.Net.Search.Query