From 177568a61f77f13e618c04154c87bf26c5af8bd6 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Wed, 22 Aug 2012 13:15:22 +0200 Subject: [PATCH] no need to optimize on the bool query parser, we already do that in the optimizeQuery method --- .../elasticsearch/index/query/BoolQueryParser.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/main/java/org/elasticsearch/index/query/BoolQueryParser.java b/src/main/java/org/elasticsearch/index/query/BoolQueryParser.java index e13589db2a9..da69ec8d1da 100644 --- a/src/main/java/org/elasticsearch/index/query/BoolQueryParser.java +++ b/src/main/java/org/elasticsearch/index/query/BoolQueryParser.java @@ -128,20 +128,6 @@ public class BoolQueryParser implements QueryParser { return null; } - if (clauses.size() == 1) { - BooleanClause clause = clauses.get(0); - if (clause.getOccur() == BooleanClause.Occur.MUST) { - Query query = clause.getQuery(); - query.setBoost(boost * query.getBoost()); - return query; - } - if (clause.getOccur() == BooleanClause.Occur.SHOULD && minimumNumberShouldMatch > 0) { - Query query = clause.getQuery(); - query.setBoost(boost * query.getBoost()); - return query; - } - } - BooleanQuery query = new BooleanQuery(disableCoord); for (BooleanClause clause : clauses) { query.add(clause);