mirror of https://github.com/apache/lucene.git
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:
parent
de12906bd3
commit
61a6b8db77
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue