diff --git a/core/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java index 9066262810c..80eb94f4276 100644 --- a/core/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java @@ -43,17 +43,12 @@ public class SpanNearQueryBuilder extends AbstractQueryBuilder clauses = new ArrayList<>(); private final int slop; private boolean inOrder = DEFAULT_IN_ORDER; - private boolean collectPayloads = DEFAULT_COLLECT_PAYLOADS; - static final SpanNearQueryBuilder PROTOTYPE = new SpanNearQueryBuilder(SpanTermQueryBuilder.PROTOTYPE, 0); /** @@ -107,21 +102,6 @@ public class SpanNearQueryBuilder extends AbstractQueryBuilder { public static final ParseField COLLECT_PAYLOADS_FIELD = new ParseField("collect_payloads"); public static final ParseField CLAUSES_FIELD = new ParseField("clauses"); public static final ParseField IN_ORDER_FIELD = new ParseField("in_order"); - + @Override public String[] names() { return new String[]{SpanNearQueryBuilder.NAME, Strings.toCamelCase(SpanNearQueryBuilder.NAME)}; @@ -50,7 +50,6 @@ public class SpanNearQueryParser implements QueryParser { float boost = AbstractQueryBuilder.DEFAULT_BOOST; Integer slop = null; boolean inOrder = SpanNearQueryBuilder.DEFAULT_IN_ORDER; - boolean collectPayloads = SpanNearQueryBuilder.DEFAULT_COLLECT_PAYLOADS; String queryName = null; List clauses = new ArrayList<>(); @@ -76,7 +75,7 @@ public class SpanNearQueryParser implements QueryParser { if (parseContext.parseFieldMatcher().match(currentFieldName, IN_ORDER_FIELD)) { inOrder = parser.booleanValue(); } else if (parseContext.parseFieldMatcher().match(currentFieldName, COLLECT_PAYLOADS_FIELD)) { - collectPayloads = parser.booleanValue(); + // Deprecated in 3.0.0 } else if (parseContext.parseFieldMatcher().match(currentFieldName, SLOP_FIELD)) { slop = parser.intValue(); } else if (parseContext.parseFieldMatcher().match(currentFieldName, AbstractQueryBuilder.BOOST_FIELD)) { @@ -104,7 +103,6 @@ public class SpanNearQueryParser implements QueryParser { queryBuilder.clause(clauses.get(i)); } queryBuilder.inOrder(inOrder); - queryBuilder.collectPayloads(collectPayloads); queryBuilder.boost(boost); queryBuilder.queryName(queryName); return queryBuilder; diff --git a/core/src/test/java/org/elasticsearch/index/query/QueryDSLDocumentationTests.java b/core/src/test/java/org/elasticsearch/index/query/QueryDSLDocumentationTests.java index 028987448f0..65c2ee046fe 100644 --- a/core/src/test/java/org/elasticsearch/index/query/QueryDSLDocumentationTests.java +++ b/core/src/test/java/org/elasticsearch/index/query/QueryDSLDocumentationTests.java @@ -331,8 +331,7 @@ public class QueryDSLDocumentationTests extends ESTestCase { spanNearQuery(spanTermQuery("field","value1"), 12) .clause(spanTermQuery("field","value2")) .clause(spanTermQuery("field","value3")) - .inOrder(false) - .collectPayloads(false); + .inOrder(false); } public void testSpanNot() { diff --git a/core/src/test/java/org/elasticsearch/index/query/SpanContainingQueryBuilderTests.java b/core/src/test/java/org/elasticsearch/index/query/SpanContainingQueryBuilderTests.java index 79089b57fb4..f6d18447c94 100644 --- a/core/src/test/java/org/elasticsearch/index/query/SpanContainingQueryBuilderTests.java +++ b/core/src/test/java/org/elasticsearch/index/query/SpanContainingQueryBuilderTests.java @@ -56,41 +56,40 @@ public class SpanContainingQueryBuilderTests extends AbstractQueryTestCase