lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r590684 - /lucene/solr/trunk/src/java/org/apache/solr/search/LuceneQParserPlugin.java
Date Wed, 31 Oct 2007 14:47:04 GMT
Author: yonik
Date: Wed Oct 31 07:47:03 2007
New Revision: 590684

URL: http://svn.apache.org/viewvc?rev=590684&view=rev
Log:
lucene qparser should pay attention to default operator in schema

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/search/LuceneQParserPlugin.java

Modified: lucene/solr/trunk/src/java/org/apache/solr/search/LuceneQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/search/LuceneQParserPlugin.java?rev=590684&r1=590683&r2=590684&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/search/LuceneQParserPlugin.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/search/LuceneQParserPlugin.java Wed Oct 31
07:47:03 2007
@@ -69,6 +69,11 @@
     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);



Mime
View raw message