Search in sources :

Example 1 with ExtendableQueryParser

use of org.apache.lucene.queryparser.ext.ExtendableQueryParser in project fess by codelibs.

the class QueryHelperTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    queryHelper = new QueryHelper() {

        protected QueryParser getQueryParser() {
            ExtendableQueryParser queryParser = new ExtendableQueryParser(Constants.DEFAULT_FIELD, new WhitespaceAnalyzer());
            queryParser.setLowercaseExpandedTerms(false);
            queryParser.setAllowLeadingWildcard(true);
            queryParser.setDefaultOperator(QueryParser.Operator.AND);
            return queryParser;
        }
    };
    final FessConfig fessConfig = ComponentUtil.getFessConfig();
    registerMockInstance(fessConfig);
    registerMockInstance(new SystemHelper());
    inject(queryHelper);
    queryHelper.init();
}
Also used : WhitespaceAnalyzer(org.apache.lucene.analysis.core.WhitespaceAnalyzer) QueryParser(org.apache.lucene.queryparser.classic.QueryParser) ExtendableQueryParser(org.apache.lucene.queryparser.ext.ExtendableQueryParser) FessConfig(org.codelibs.fess.mylasta.direction.FessConfig) ExtendableQueryParser(org.apache.lucene.queryparser.ext.ExtendableQueryParser)

Aggregations

WhitespaceAnalyzer (org.apache.lucene.analysis.core.WhitespaceAnalyzer)1 QueryParser (org.apache.lucene.queryparser.classic.QueryParser)1 ExtendableQueryParser (org.apache.lucene.queryparser.ext.ExtendableQueryParser)1 FessConfig (org.codelibs.fess.mylasta.direction.FessConfig)1