From c169e792b50b02d0d562d1ca749d2d9e45a039e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Tue, 14 Apr 2015 12:39:05 +0200 Subject: [PATCH] Remove unused normsField from MatchAllQuery --- .../index/query/MatchAllQueryBuilder.java | 13 ------------- .../index/query/MatchAllQueryParser.java | 2 -- .../fullrestart/FullRestartStressTest.java | 2 +- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/main/java/org/elasticsearch/index/query/MatchAllQueryBuilder.java b/src/main/java/org/elasticsearch/index/query/MatchAllQueryBuilder.java index 8cee9153e1d..78a91a7fb73 100644 --- a/src/main/java/org/elasticsearch/index/query/MatchAllQueryBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/MatchAllQueryBuilder.java @@ -30,18 +30,8 @@ import java.io.IOException; */ public class MatchAllQueryBuilder extends BaseQueryBuilder implements BoostableQueryBuilder { - private String normsField; - private float boost = -1; - /** - * Field used for normalization factor (document boost). Defaults to no field. - */ - public MatchAllQueryBuilder normsField(String normsField) { - this.normsField = normsField; - return this; - } - /** * Sets the boost for this query. Documents matching this query will (in addition to the normal * weightings) have their score multiplied by the boost provided. @@ -58,9 +48,6 @@ public class MatchAllQueryBuilder extends BaseQueryBuilder implements BoostableQ if (boost != -1) { builder.field("boost", boost); } - if (normsField != null) { - builder.field("norms_field", normsField); - } builder.endObject(); } } \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/query/MatchAllQueryParser.java b/src/main/java/org/elasticsearch/index/query/MatchAllQueryParser.java index ded63f184d1..2017b940921 100644 --- a/src/main/java/org/elasticsearch/index/query/MatchAllQueryParser.java +++ b/src/main/java/org/elasticsearch/index/query/MatchAllQueryParser.java @@ -68,8 +68,6 @@ public class MatchAllQueryParser implements QueryParser { return Queries.newMatchAllQuery(); } - //LUCENE 4 UPGRADE norms field is not supported anymore need to find another way or drop the functionality - //MatchAllDocsQuery query = new MatchAllDocsQuery(normsField); MatchAllDocsQuery query = new MatchAllDocsQuery(); query.setBoost(boost); return query; diff --git a/src/test/java/org/elasticsearch/stresstest/fullrestart/FullRestartStressTest.java b/src/test/java/org/elasticsearch/stresstest/fullrestart/FullRestartStressTest.java index 387bf52e966..6690c41270b 100644 --- a/src/test/java/org/elasticsearch/stresstest/fullrestart/FullRestartStressTest.java +++ b/src/test/java/org/elasticsearch/stresstest/fullrestart/FullRestartStressTest.java @@ -147,7 +147,7 @@ public class FullRestartStressTest { // verify search for (int i = 0; i < (nodes.length * 5); i++) { // do a search with norms field, so we don't rely on match all filtering cache - SearchResponse search = client.client().prepareSearch().setQuery(matchAllQuery().normsField("field")).execute().actionGet(); + SearchResponse search = client.client().prepareSearch().setQuery(matchAllQuery()).execute().actionGet(); logger.debug("index_count [{}], expected_count [{}]", search.getHits().totalHits(), indexCounter.get()); if (count.getCount() != indexCounter.get()) { logger.warn("!!! search does not match, index_count [{}], expected_count [{}]", search.getHits().totalHits(), indexCounter.get());