From 97c4c43fb773f4831f5408e1c8c20f11088f7bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Thu, 13 Jul 2017 09:21:49 +0200 Subject: [PATCH] Make slop optional when parsing `span_near` query (#25677) The slop parameter defaults to 0 in the Lucene SpanNearQuery, so we can set it to this default value also and don't have to require it being specified in the query when using the Rest API. Leaving `slop` a ctro arg in the Java API as it should normally be specified and we can keep it `final` that way. Closes #25642 --- .../index/query/SpanNearQueryBuilder.java | 10 ++++----- .../query/SpanNearQueryBuilderTests.java | 22 +++++++++++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) 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 a7e4c77532f..6255a361e80 100644 --- a/core/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java @@ -45,6 +45,8 @@ public class SpanNearQueryBuilder extends AbstractQueryBuilder clauses = new ArrayList<>(); @@ -189,10 +191,6 @@ public class SpanNearQueryBuilder extends AbstractQueryBuilder