Namespace Lucene.Net.QueryParsers.ComplexPhrase
QueryParser which permits complex phrase query syntax eg "(john jon jonathan~) peters*"
Classes
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
ComplexPhraseQueryParser.ComplexPhraseQuery
Used to handle the query content in between quotes and produced Span-based interpretations of the clauses.