NamedWriteable, Writeable, ToXContent, ToXContentObject, Rewriteable<SortBuilder<?>>public class GeoDistanceSortBuilder extends SortBuilder<GeoDistanceSortBuilder>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsWriteable.Reader<V>, Writeable.Writer<V>| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
ALTERNATIVE_NAME |
|
static GeoValidationMethod |
DEFAULT_VALIDATION |
|
static java.lang.String |
NAME |
MAX_REWRITE_ROUNDSNESTED_FILTER_FIELD, NESTED_PATH_FIELD, order, ORDER_FIELDEMPTY_PARAMS| Constructor | Description |
|---|---|
GeoDistanceSortBuilder(java.lang.String fieldName,
double lat,
double lon) |
Constructs a new distance based sort on a geo point like field.
|
GeoDistanceSortBuilder(java.lang.String fieldName,
java.lang.String... geohashes) |
Constructs a new distance based sort on a geo point like field.
|
GeoDistanceSortBuilder(java.lang.String fieldName,
GeoPoint... points) |
Constructs a new distance based sort on a geo point like field.
|
GeoDistanceSortBuilder(StreamInput in) |
Read from a stream.
|
| Modifier and Type | Method | Description |
|---|---|---|
SortFieldAndFormat |
build(QueryShardContext context) |
Create a @link
SortFieldAndFormat from this builder. |
boolean |
equals(java.lang.Object object) |
|
java.lang.String |
fieldName() |
Returns the geo point like field the distance based sort operates on.
|
static GeoDistanceSortBuilder |
fromXContent(XContentParser parser,
java.lang.String elementName) |
|
GeoDistance |
geoDistance() |
Returns the geo distance type used to compute the distance.
|
GeoDistanceSortBuilder |
geoDistance(GeoDistance geoDistance) |
The geo distance type used to compute the distance.
|
GeoDistanceSortBuilder |
geohashes(java.lang.String... geohashes) |
Deprecated.
|
QueryBuilder |
getNestedFilter() |
Deprecated.
set nested sort with
setNestedSort(NestedSortBuilder)
and retrieve with getNestedSort() |
java.lang.String |
getNestedPath() |
Deprecated.
set nested sort with
setNestedSort(NestedSortBuilder)
and retrieve with getNestedSort() |
NestedSortBuilder |
getNestedSort() |
Returns the
NestedSortBuilder |
java.lang.String |
getWriteableName() |
Returns the name of the writeable object
|
int |
hashCode() |
|
GeoDistanceSortBuilder |
point(double lat,
double lon) |
The point to create the range distance facets from.
|
GeoPoint[] |
points() |
Returns the points to create the range distance facets from.
|
GeoDistanceSortBuilder |
points(GeoPoint... points) |
The point to create the range distance facets from.
|
GeoDistanceSortBuilder |
rewrite(QueryRewriteContext ctx) |
Rewrites this instance based on the provided context.
|
GeoDistanceSortBuilder |
setNestedFilter(QueryBuilder nestedFilter) |
Deprecated.
set nested sort with
setNestedSort(NestedSortBuilder)
and retrieve with getNestedSort() |
GeoDistanceSortBuilder |
setNestedPath(java.lang.String nestedPath) |
Deprecated.
set nested sort with
setNestedSort(NestedSortBuilder)
and retrieve with getNestedSort() |
GeoDistanceSortBuilder |
setNestedSort(NestedSortBuilder nestedSort) |
Sets the
NestedSortBuilder to be used for fields that are inside a nested
object. |
SortMode |
sortMode() |
Returns which distance to use for sorting in the case a document contains multiple geo points.
|
GeoDistanceSortBuilder |
sortMode(SortMode sortMode) |
Defines which distance to use for sorting in the case a document contains multiple geo points.
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
|
DistanceUnit |
unit() |
Returns the distance unit to use.
|
GeoDistanceSortBuilder |
unit(DistanceUnit unit) |
The distance unit to use.
|
GeoValidationMethod |
validation() |
Returns the validation method to use for this sort builder.
|
GeoDistanceSortBuilder |
validation(GeoValidationMethod method) |
Sets validation method for this sort builder.
|
void |
writeTo(StreamOutput out) |
Write this into the StreamOutput.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitrewrite, rewrite, rewrite, rewriteAndFetch, rewriteAndFetchbuildSort, fromXContent, order, order, parseNestedFilter, resolveNested, resolveNested, toStringisFragmentpublic static final java.lang.String NAME
public static final java.lang.String ALTERNATIVE_NAME
public static final GeoValidationMethod DEFAULT_VALIDATION
public GeoDistanceSortBuilder(java.lang.String fieldName,
GeoPoint... points)
fieldName - The geo point like field name.points - The points to create the range distance facets from.public GeoDistanceSortBuilder(java.lang.String fieldName,
double lat,
double lon)
fieldName - The geo point like field name.lat - Latitude of the point to create the range distance facets from.lon - Longitude of the point to create the range distance facets from.public GeoDistanceSortBuilder(java.lang.String fieldName,
java.lang.String... geohashes)
fieldName - The geo point like field name.geohashes - The points to create the range distance facets from.public GeoDistanceSortBuilder(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic void writeTo(StreamOutput out) throws java.io.IOException
Writeablejava.io.IOExceptionpublic java.lang.String fieldName()
public GeoDistanceSortBuilder point(double lat, double lon)
lat - latitude.lon - longitude.public GeoDistanceSortBuilder points(GeoPoint... points)
points - reference points.public GeoPoint[] points()
@Deprecated public GeoDistanceSortBuilder geohashes(java.lang.String... geohashes)
public GeoDistanceSortBuilder geoDistance(GeoDistance geoDistance)
public GeoDistance geoDistance()
public GeoDistanceSortBuilder unit(DistanceUnit unit)
DistanceUnit.METERSpublic DistanceUnit unit()
DistanceUnit.METERSpublic GeoDistanceSortBuilder validation(GeoValidationMethod method)
public GeoValidationMethod validation()
public GeoDistanceSortBuilder sortMode(SortMode sortMode)
public SortMode sortMode()
@Deprecated public GeoDistanceSortBuilder setNestedFilter(QueryBuilder nestedFilter)
setNestedSort(NestedSortBuilder)
and retrieve with getNestedSort()@Deprecated public QueryBuilder getNestedFilter()
setNestedSort(NestedSortBuilder)
and retrieve with getNestedSort()@Deprecated public GeoDistanceSortBuilder setNestedPath(java.lang.String nestedPath)
setNestedSort(NestedSortBuilder)
and retrieve with getNestedSort()@Deprecated public java.lang.String getNestedPath()
setNestedSort(NestedSortBuilder)
and retrieve with getNestedSort()public NestedSortBuilder getNestedSort()
NestedSortBuilderpublic GeoDistanceSortBuilder setNestedSort(NestedSortBuilder nestedSort)
NestedSortBuilder to be used for fields that are inside a nested
object. The NestedSortBuilder takes a `path` argument and an optional
nested filter that the nested objects should match with in
order to be taken into account for sorting.public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getWriteableName()
NamedWriteablepublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic static GeoDistanceSortBuilder fromXContent(XContentParser parser, java.lang.String elementName) throws java.io.IOException
parser - the input parser. The state on the parser contained in this context will be changed as a
side effect of this method callelementName - in some sort syntax variations the field name precedes the xContent object that specifies
further parameters, e.g. in '{ "foo": { "order" : "asc"} }'. When parsing the inner object,
the field name can be passed in via this argumentjava.io.IOExceptionpublic SortFieldAndFormat build(QueryShardContext context) throws java.io.IOException
SortBuilderSortFieldAndFormat from this builder.build in class SortBuilder<GeoDistanceSortBuilder>java.io.IOExceptionpublic GeoDistanceSortBuilder rewrite(QueryRewriteContext ctx) throws java.io.IOException
Rewriteablejava.io.IOException