lucene qparser should pay attention to default operator in schema

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@590684 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2007-10-31 14:47:03 +00:00
parent de12906bd3
commit 61a6b8db77
1 changed files with 5 additions and 0 deletions

View File

@ -69,6 +69,11 @@ class LuceneQParser extends QParser {
String opParam = getParam(QueryParsing.OP);
if (opParam != null) {
lparser.setDefaultOperator("AND".equals(opParam) ? QueryParser.Operator.AND : QueryParser.Operator.OR);
} else {
// try to get default operator from schema
String operator = getReq().getSchema().getQueryParserDefaultOperator();
lparser.setDefaultOperator("AND".equals(operator) ?
QueryParser.Operator.AND : QueryParser.Operator.OR);
}
return lparser.parse(qstr);