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;