Class AnalyzingQueryParser

  • All Implemented Interfaces:
    QueryParserConstants, CommonQueryParserConfiguration

    public class AnalyzingQueryParser
    extends QueryParser
    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).

    • Constructor Detail

      • AnalyzingQueryParser

        public AnalyzingQueryParser​(Version matchVersion,
                                    java.lang.String field,
                                    Analyzer analyzer)