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
This commit is contained in:
Isabel Drost-Fromm 2016-01-26 12:35:51 +01:00
parent 716e7267f3
commit 7b5b0d4511
5 changed files with 0 additions and 30 deletions

View File

@ -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 <tt>_last</tt> or * Sets the value when a field is missing in a doc. Can also be set to <tt>_last</tt> or
* <tt>_first</tt> to sort missing last or first respectively. * <tt>_first</tt> to sort missing last or first respectively.
*/ */
@Override
public FieldSortBuilder missing(Object missing) { public FieldSortBuilder missing(Object missing) {
this.missing = missing; this.missing = missing;
return this; return this;

View File

@ -218,16 +218,6 @@ public class GeoDistanceSortBuilder extends SortBuilder
return this.order; 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. * Defines which distance to use for sorting in the case a document contains multiple geo points.
* Possible values: min and max * Possible values: min and max

View File

@ -41,11 +41,6 @@ public class ScoreSortBuilder extends SortBuilder {
return this; return this;
} }
@Override
public SortBuilder missing(Object missing) {
return this;
}
@Override @Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject("_score"); builder.startObject("_score");

View File

@ -62,14 +62,6 @@ public class ScriptSortBuilder extends SortBuilder {
return this; 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. * Defines which distance to use for sorting in the case a document contains multiple geo points.
* Possible values: min and max * Possible values: min and max

View File

@ -45,10 +45,4 @@ public abstract class SortBuilder implements ToXContent {
* The order of sorting. Defaults to {@link SortOrder#ASC}. * The order of sorting. Defaults to {@link SortOrder#ASC}.
*/ */
public abstract SortBuilder order(SortOrder order); public abstract SortBuilder order(SortOrder order);
/**
* Sets the value when a field is missing in a doc. Can also be set to <tt>_last</tt> or
* <tt>_first</tt> to sort missing last or first respectively.
*/
public abstract SortBuilder missing(Object missing);
} }