Class 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
System.Object
ComplexPhraseQueryParser
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
public class ComplexPhraseQueryParser : QueryParser, ICommonQueryParserConfiguration
Constructors
|
Improve this Doc
View Source
ComplexPhraseQueryParser(LuceneVersion, String, Analyzer)
Declaration
public ComplexPhraseQueryParser(LuceneVersion matchVersion, string f, Analyzer a)
Parameters
Properties
|
Improve this Doc
View Source
InOrder
When InOrder is true, the search terms must
exists in the documents as the same order as in query.
Choose between ordered (true) or un-ordered (false) proximity search.
Declaration
public virtual bool InOrder { get; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
|
Improve this Doc
View Source
GetFieldQuery(String, String, Int32)
Declaration
protected override Query GetFieldQuery(string field, string queryText, int slop)
Parameters
Type |
Name |
Description |
System.String |
field |
|
System.String |
queryText |
|
System.Int32 |
slop |
|
Returns
Overrides
|
Improve this Doc
View Source
GetFuzzyQuery(String, String, Single)
Declaration
protected override Query GetFuzzyQuery(string field, string termStr, float minSimilarity)
Parameters
Type |
Name |
Description |
System.String |
field |
|
System.String |
termStr |
|
System.Single |
minSimilarity |
|
Returns
Overrides
|
Improve this Doc
View Source
GetRangeQuery(String, String, String, Boolean, Boolean)
Declaration
protected override Query GetRangeQuery(string field, string part1, string part2, bool startInclusive, bool endInclusive)
Parameters
Type |
Name |
Description |
System.String |
field |
|
System.String |
part1 |
|
System.String |
part2 |
|
System.Boolean |
startInclusive |
|
System.Boolean |
endInclusive |
|
Returns
Overrides
|
Improve this Doc
View Source
GetWildcardQuery(String, String)
Declaration
protected override Query GetWildcardQuery(string field, string termStr)
Parameters
Type |
Name |
Description |
System.String |
field |
|
System.String |
termStr |
|
Returns
Overrides
|
Improve this Doc
View Source
NewRangeQuery(String, String, String, Boolean, Boolean)
Declaration
protected override Query NewRangeQuery(string field, string part1, string part2, bool startInclusive, bool endInclusive)
Parameters
Type |
Name |
Description |
System.String |
field |
|
System.String |
part1 |
|
System.String |
part2 |
|
System.Boolean |
startInclusive |
|
System.Boolean |
endInclusive |
|
Returns
Overrides
|
Improve this Doc
View Source
NewTermQuery(Term)
Declaration
protected override Query NewTermQuery(Term term)
Parameters
Type |
Name |
Description |
Term |
term |
|
Returns
Overrides
|
Improve this Doc
View Source
Parse(String)
Declaration
public override Query Parse(string query)
Parameters
Type |
Name |
Description |
System.String |
query |
|
Returns
Overrides
Implements