From 9a8e033424e1fe9300599f6af2be40e547e2cab8 Mon Sep 17 00:00:00 2001 From: kimchy Date: Fri, 22 Oct 2010 14:50:48 +0200 Subject: [PATCH] improve fixing negative query with adding the optimized match_all query --- .../java/org/elasticsearch/common/lucene/search/Queries.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/search/Queries.java b/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/search/Queries.java index 48a47304846..b44dd7d71bf 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/search/Queries.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/search/Queries.java @@ -82,7 +82,7 @@ public class Queries { public static Query fixNegativeQueryIfNeeded(Query q) { if (isNegativeQuery(q)) { BooleanQuery newBq = (BooleanQuery) q.clone(); - newBq.add(new MatchAllDocsQuery(), BooleanClause.Occur.MUST); + newBq.add(MATCH_ALL_QUERY, BooleanClause.Occur.MUST); return newBq; } return q;