C# (CSharp) Lucene.Net.QueryParsers.Classic Namespace

Classes

Name Description
FastCharStream An efficient implementation of JavaCC's CharStream interface.

Note that this does not do line-number counting, but instead keeps track of the character position of the token in the input, as required by Lucene's Lucene.Net.Analysis.Token API.

LexicalToken
MultiFieldQueryParser A QueryParser which constructs queries to search multiple fields.
ParseException
QueryParser This class is generated by JavaCC. The most important method is QueryParserBase.Parse(string). The syntax for query strings is as follows: A Query is a series of clauses. A clause may be prefixed by: a plus (+) or a minus (-) sign, indicating that the clause is required or prohibited respectively; or a term followed by a colon, indicating the field to be searched. This enables one to construct queries which search multiple fields. A clause may be either: a term, indicating all the documents that contain this term; or a nested query, enclosed in parentheses. Note that this may be used with a +/- prefix to require any of a set of terms. Thus, in BNF, the query grammar is: Query ::= ( Clause )* Clause ::= ["+", "-"] [<TERM> ":"] ( <TERM> | "(" Query ")" )

Examples of appropriately formatted queries can be found in the query syntax documentation.

In TermRangeQuerys, QueryParser tries to detect date values, e.g. date:[6/1/2005 TO 6/4/2005] produces a range query that searches for "date" fields between 2005-06-01 and 2005-06-04. Note that the format of the accepted input depends on the Locale. A Documents.DateTools.Resolution has to be set, if you want to use Documents.DateTools for date conversion.

The date resolution that shall be used for RangeQueries can be set using QueryParserBase.SetDateResolution(Documents.DateTools.Resolution) or QueryParserBase.SetDateResolution(string, Documents.DateTools.Resolution). The former sets the default date resolution for all fields, whereas the latter can be used to set field specific date resolutions. Field specific date resolutions take, if set, precedence over the default date resolution.

If you don't use Documents.DateTools in your index, you can create your own query parser that inherits QueryParser and overwrites QueryParserBase.GetRangeQuery(string, string, string, bool, bool) to use a different method for date conversion.

Note that QueryParser is not thread-safe.

NOTE: there is a new QueryParser in contrib, which matches the same syntax as this class, but is more modular, enabling substantial customization to how a query is created.

NOTE: You must specify the required LuceneVersion compatibility when creating QueryParser: As of 3.1, QueryParserBase.AutoGeneratePhraseQueries is false by default.
QueryParser.JJCalls
QueryParserConstants Token literal values and constants. Generated by org.javacc.parser.OtherFilesGen#start()
QueryParserTokenManager Token Manager.
RegexpToken
TestMultiAnalyzer_
TestMultiAnalyzer_.DumbQueryParser a very simple subclass of QueryParser
TestMultiAnalyzer_.DumbQueryWrapper A very simple wrapper to prevent instanceof checks but uses the toString of the query it wraps.
TestMultiAnalyzer_.MultiAnalyzer Expands "multi" to "multi" and "multi2", both at the same position, and expands "triplemulti" to "triplemulti", "multi3", and "multi2".
TestMultiAnalyzer_.PosIncrementAnalyzer Analyzes "the quick brown" as: quick(incr=2) brown(incr=1). Does not work correctly for input other than "the quick brown ...".
TestMultiAnalyzer_.TestFilter
TestMultiAnalyzer_.TestPosIncrementFilter
TestMultiFieldQueryParser
TestMultiFieldQueryParser.AnalyzerReturningNull
TestMultiPhraseQueryParsing_
TestMultiPhraseQueryParsing_.CannedAnalyzer
TestMultiPhraseQueryParsing_.CannedTokenizer
TestMultiPhraseQueryParsing_.TokenAndPos
TestQueryParser
TestQueryParser.MockCJKSynonymAnalyzer
TestQueryParser.MockCJKSynonymFilter adds synonym of "國" for "国".
TestQueryParser.MockSynonymAnalyzer adds synonym of "dog" for "dogs".
TestQueryParser.QPTestParser
TestQueryParser.SmartQueryParser query parser that doesn't expand synonyms when users use double quotes
TestQueryParser.TestFuzzySlopeExtendabilityQueryParser
TestQueryParser.TestStarParsingQueryParser
Token
TokenMgrError