From 7b5b0d451159198706b98f0da4cd770c7a31be2a Mon Sep 17 00:00:00 2001 From: Isabel Drost-Fromm Date: Tue, 26 Jan 2016 12:35:51 +0100 Subject: [PATCH] Move missing() from SortBuilder interface to class As mentioned by @cbuescher on #16151 this method is really implemented only in the FieldSortBuilder. Moving the method down. Relates to #15178 --- .../elasticsearch/search/sort/FieldSortBuilder.java | 1 - .../search/sort/GeoDistanceSortBuilder.java | 10 ---------- .../elasticsearch/search/sort/ScoreSortBuilder.java | 5 ----- .../elasticsearch/search/sort/ScriptSortBuilder.java | 8 -------- .../org/elasticsearch/search/sort/SortBuilder.java | 6 ------ 5 files changed, 30 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java b/core/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java index 4f082b057da..67ceb75a29c 100644 --- a/core/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java @@ -68,7 +68,6 @@ public class FieldSortBuilder extends SortBuilder { * Sets the value when a field is missing in a doc. Can also be set to _last or * _first to sort missing last or first respectively. */ - @Override public FieldSortBuilder missing(Object missing) { this.missing = missing; return this; diff --git a/core/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortBuilder.java b/core/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortBuilder.java index e37eed61c6d..708152af1f0 100644 --- a/core/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortBuilder.java @@ -218,16 +218,6 @@ public class GeoDistanceSortBuilder extends SortBuilder return this.order; } - /** - * Not relevant. - * - * TODO should this throw an exception rather than silently ignore a parameter that is not used? - */ - @Override - public GeoDistanceSortBuilder missing(Object missing) { - return this; - } - /** * Defines which distance to use for sorting in the case a document contains multiple geo points. * Possible values: min and max diff --git a/core/src/main/java/org/elasticsearch/search/sort/ScoreSortBuilder.java b/core/src/main/java/org/elasticsearch/search/sort/ScoreSortBuilder.java index 7435ff95f45..e70a34a7c3b 100644 --- a/core/src/main/java/org/elasticsearch/search/sort/ScoreSortBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/sort/ScoreSortBuilder.java @@ -41,11 +41,6 @@ public class ScoreSortBuilder extends SortBuilder { return this; } - @Override - public SortBuilder missing(Object missing) { - return this; - } - @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject("_score"); diff --git a/core/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java b/core/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java index e9a9c8df57c..d02e4dc520a 100644 --- a/core/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java @@ -62,14 +62,6 @@ public class ScriptSortBuilder extends SortBuilder { return this; } - /** - * Not really relevant. - */ - @Override - public SortBuilder missing(Object missing) { - return this; - } - /** * Defines which distance to use for sorting in the case a document contains multiple geo points. * Possible values: min and max diff --git a/core/src/main/java/org/elasticsearch/search/sort/SortBuilder.java b/core/src/main/java/org/elasticsearch/search/sort/SortBuilder.java index da80506dde2..0935b76ece9 100644 --- a/core/src/main/java/org/elasticsearch/search/sort/SortBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/sort/SortBuilder.java @@ -45,10 +45,4 @@ public abstract class SortBuilder implements ToXContent { * The order of sorting. Defaults to {@link SortOrder#ASC}. */ public abstract SortBuilder order(SortOrder order); - - /** - * Sets the value when a field is missing in a doc. Can also be set to _last or - * _first to sort missing last or first respectively. - */ - public abstract SortBuilder missing(Object missing); }