@StableMinor(version="10.1", sinceVersion="9.0") public class GeoDistanceAggregation extends Object implements IFieldAwareAggregation
center point
and a collection of ranges
.IGeoDistanceAggregationResult
.
Each range will generate a bucket
to store documents that that have a distance that fit into the given range.
The given field
will be used to calculate the geo distance to the given center point
.
Thus, the given field must be of the data type
DocumentTypeField.DataType.GEO_POINT
.
If the given field is a list
, the closest point to the center will be considered.
It is important to notice that at least one range must be added
.
Distance
,
Range
,
IMultiBucketAggregationResult
,
IGeoDistanceAggregationResult
,
GeoPoint
,
SearchQuery.addAggregation(IAggregation)
Constructor and Description |
---|
GeoDistanceAggregation(String id,
DocumentTypeField field,
GeoPoint pin)
Creates a new instance of the aggregation.
|
Modifier and Type | Method and Description |
---|---|
GeoDistanceAggregation |
addRanges(Collection<Range<Double>> ranges)
Add the given ranges to the aggregation.
|
GeoDistanceAggregation |
addRanges(Range<Double>... ranges)
Add the given ranges to the aggregation.
|
void |
addSubAggregation(IAggregation aggregation)
Adds the given sub-aggregation.
|
void |
addSubAggregations(IAggregation... aggregations)
Adds the given sub-aggregations.
|
void |
addSubAggregations(List<IAggregation> aggregations)
Adds the given sub-aggregations.
|
DocumentTypeField |
getField()
Returns the field this aggregation is bound to.
|
String |
getId()
Returns the aggregation identifier.
|
GeoPoint |
getPin()
Returns the center point of the aggregation.
|
List<Range<Double>> |
getRanges()
Returns the range list.
|
List<IAggregation> |
getSubAggregations()
Returns an unmodifiable list of the sub-aggregations.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getId
public GeoDistanceAggregation(String id, DocumentTypeField field, GeoPoint pin)
id
- the aggregation identifier.field
- the field to be used to calculate the distance to the center point.pin
- the center point from which the distance will be calculated.public GeoDistanceAggregation addRanges(Range<Double>... ranges)
ranges
- the ranges.public GeoDistanceAggregation addRanges(Collection<Range<Double>> ranges)
ranges
- the ranges.public List<Range<Double>> getRanges()
public DocumentTypeField getField()
IFieldAwareAggregation
getField
in interface IFieldAwareAggregation
public GeoPoint getPin()
public String getId()
IAggregation
getId
in interface IAggregation
public void addSubAggregation(IAggregation aggregation)
ISubAggregationAwareAggregation
addSubAggregation
in interface ISubAggregationAwareAggregation
public List<IAggregation> getSubAggregations()
ISubAggregationAwareAggregation
getSubAggregations
in interface ISubAggregationAwareAggregation
public void addSubAggregations(IAggregation... aggregations)
ISubAggregationAwareAggregation
addSubAggregations
in interface ISubAggregationAwareAggregation
aggregations
- the sub-aggregations.public void addSubAggregations(List<IAggregation> aggregations)
ISubAggregationAwareAggregation
addSubAggregations
in interface ISubAggregationAwareAggregation
aggregations
- the sub-aggregations.Lumisportal 10.1.2.170428 - Copyright © 2006–2017 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.