org.apache.lucene.queryParser.analyzing
public class AnalyzingQueryParser extends QueryParser
?
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).
Version: $Revision$, $Date$
Constructor Summary | |
---|---|
AnalyzingQueryParser(String field, Analyzer analyzer)
Constructs a query parser. |
Method Summary | |
---|---|
protected Query | getFuzzyQuery(String field, String termStr, float minSimilarity)
Called when parser parses an input term token that has the fuzzy suffix (~) appended.
|
protected Query | getPrefixQuery(String field, String termStr)
Called when parser parses an input term
token that uses prefix notation; that is, contains a single '*' wildcard
character as its last character. |
protected Query | getRangeQuery(String field, String part1, String part2, boolean inclusive)
Overrides super class, by passing terms through analyzer. |
protected Query | getWildcardQuery(String field, String termStr)
Called when parser
parses an input term token that contains one or more wildcard
characters (? |
Parameters: field the default field for query terms. analyzer used to find terms in the query text.
Depending on analyzer and settings, a fuzzy term may (most probably will) be lower-cased automatically. It will go through the default Analyzer.
Overrides super class, by passing terms through analyzer.
Parameters: field Name of the field query will use. termStr Term token to use for building term for the query
Returns: Resulting Query built for the term
Throws: ParseException
Depending on analyzer and settings, a prefix term may (most probably will) be lower-cased automatically. It will go through the default Analyzer.
Overrides super class, by passing terms through analyzer.
Parameters: field Name of the field query will use. termStr Term token to use for building term for the query (without trailing '*' character!)
Returns: Resulting Query built for the term
Throws: ParseException
Throws: ParseException
Depending on analyzer and settings, a wildcard term may (most probably will) be lower-cased automatically. It will go through the default Analyzer.
Overrides super class, by passing terms through analyzer.
Parameters: field Name of the field query will use. termStr Term token that contains one or more wild card characters (? or *), but is not simple prefix term
Returns: Resulting Query built for the term
Throws: ParseException