Skip to content
This repository
Browse code

no need to optimize on the bool query parser, we already do that in t…

…he optimizeQuery method
  • Loading branch information...
commit 177568a61f77f13e618c04154c87bf26c5af8bd6 1 parent 3fdb9f0
Shay Banon authored August 22, 2012
14  src/main/java/org/elasticsearch/index/query/BoolQueryParser.java
@@ -128,20 +128,6 @@ public Query parse(QueryParseContext parseContext) throws IOException, QueryPars
128 128
             return null;
129 129
         }
130 130
 
131  
-        if (clauses.size() == 1) {
132  
-            BooleanClause clause = clauses.get(0);
133  
-            if (clause.getOccur() == BooleanClause.Occur.MUST) {
134  
-                Query query = clause.getQuery();
135  
-                query.setBoost(boost * query.getBoost());
136  
-                return query;
137  
-            }
138  
-            if (clause.getOccur() == BooleanClause.Occur.SHOULD && minimumNumberShouldMatch > 0) {
139  
-                Query query = clause.getQuery();
140  
-                query.setBoost(boost * query.getBoost());
141  
-                return query;
142  
-            }
143  
-        }
144  
-
145 131
         BooleanQuery query = new BooleanQuery(disableCoord);
146 132
         for (BooleanClause clause : clauses) {
147 133
             query.add(clause);

0 notes on commit 177568a

Please sign in to comment.
Something went wrong with that request. Please try again.