Class AnalyzingQueryParser
java.lang.Object
org.apache.lucene.util.QueryBuilder
org.apache.lucene.queryparser.classic.QueryParserBase
org.apache.lucene.queryparser.classic.QueryParser
org.apache.lucene.queryparser.analyzing.AnalyzingQueryParser
- All Implemented Interfaces:
QueryParserConstants
,CommonQueryParserConfiguration
Overrides Lucene's default QueryParser so that Fuzzy-, Prefix-, Range-, and WildcardQuerys
are also passed through the given analyzer, but wildcard characters
*
and
?
don't get removed from the search terms.
Warning: This class should only be used with analyzers that do not use stopwords
or that add tokens. Also, several stemming analyzers are inappropriate: for example, GermanAnalyzer
will turn Häuser
into hau
, but H?user
will
become h?user
when using this parser and thus no match would be found (i.e.
using this parser will be no improvement over QueryParser in such cases).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.queryparser.classic.QueryParser
QueryParser.Operator
Nested classes/interfaces inherited from class org.apache.lucene.queryparser.classic.QueryParserBase
QueryParserBase.MethodRemovedUseAnother
-
Field Summary
Fields inherited from class org.apache.lucene.queryparser.classic.QueryParser
jj_nt, token, token_source
Fields inherited from class org.apache.lucene.queryparser.classic.QueryParserBase
AND_OPERATOR, OR_OPERATOR
Fields inherited from interface org.apache.lucene.queryparser.classic.QueryParserConstants
_ESCAPED_CHAR, _NUM_CHAR, _QUOTED_CHAR, _TERM_CHAR, _TERM_START_CHAR, _WHITESPACE, AND, BAREOPER, Boost, CARAT, COLON, DEFAULT, EOF, FUZZY_SLOP, LPAREN, MINUS, NOT, NUMBER, OR, PLUS, PREFIXTERM, QUOTED, Range, RANGE_GOOP, RANGE_QUOTED, RANGE_TO, RANGEEX_END, RANGEEX_START, RANGEIN_END, RANGEIN_START, REGEXPTERM, RPAREN, STAR, TERM, tokenImage, WILDTERM
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.lucene.queryparser.classic.QueryParser
Clause, Conjunction, disable_tracing, enable_tracing, generateParseException, getNextToken, getToken, Modifiers, Query, ReInit, ReInit, Term, TopLevelQuery
Methods inherited from class org.apache.lucene.queryparser.classic.QueryParserBase
escape, getAllowLeadingWildcard, getAnalyzeRangeTerms, getAutoGeneratePhraseQueries, getDateResolution, getDefaultOperator, getField, getFuzzyMinSim, getFuzzyPrefixLength, getLocale, getLowercaseExpandedTerms, getMultiTermRewriteMethod, getPhraseSlop, getTimeZone, init, parse, setAllowLeadingWildcard, setAnalyzeRangeTerms, setAutoGeneratePhraseQueries, setDateResolution, setDateResolution, setDefaultOperator, setFuzzyMinSim, setFuzzyPrefixLength, setLocale, setLowercaseExpandedTerms, setMultiTermRewriteMethod, setPhraseSlop, setTimeZone
Methods inherited from class org.apache.lucene.util.QueryBuilder
createBooleanQuery, createBooleanQuery, createMinShouldMatchQuery, createPhraseQuery, createPhraseQuery, getAnalyzer, getEnablePositionIncrements, setAnalyzer, setEnablePositionIncrements
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.lucene.queryparser.flexible.standard.CommonQueryParserConfiguration
getAnalyzer, getEnablePositionIncrements, setEnablePositionIncrements
-
Constructor Details
-
AnalyzingQueryParser
-