Package lumis.portal.bigdata.query
Class GeoDistanceAggregation
- java.lang.Object
-
- lumis.portal.bigdata.query.AbstractSubAggregationAwareAggregation
-
- lumis.portal.bigdata.query.GeoDistanceAggregation
-
- All Implemented Interfaces:
IAggregation
,IFieldAwareAggregation
,ISubAggregationAwareAggregation
@StableMinor(version="14.0", sinceVersion="9.0") public class GeoDistanceAggregation extends AbstractSubAggregationAwareAggregation implements IFieldAwareAggregation
Aggregation that aggregates the documents based on acenter point
and a collection ofranges
.
This aggregation produces a result of typeIGeoDistanceAggregationResult
. Each range will generate abucket
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 givencenter point
. Thus, the given field must be of thedata 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
.- Since:
- 9.0.0
- Version:
- $Revision: 24477 $ $Date: 2021-04-28 11:30:36 -0300 (Wed, 28 Apr 2021) $
- See Also:
Distance
,Range
,IMultiBucketAggregationResult
,IGeoDistanceAggregationResult
,GeoPoint
,SearchQuery.addAggregation(IAggregation)
-
-
Constructor Summary
Constructors Constructor Description GeoDistanceAggregation(String id, DocumentTypeField field, GeoPoint pin)
Creates a new instance of the aggregation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.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.-
Methods inherited from class lumis.portal.bigdata.query.AbstractSubAggregationAwareAggregation
addSubAggregation, addSubAggregations, addSubAggregations, getSubAggregations
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface lumis.portal.bigdata.query.IAggregation
getId
-
-
-
-
Field Detail
-
id
protected final String id
-
-
Constructor Detail
-
GeoDistanceAggregation
public GeoDistanceAggregation(String id, DocumentTypeField field, GeoPoint pin)
Creates a new instance of the aggregation.- Parameters:
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.- Since:
- 9.0.0
-
-
Method Detail
-
addRanges
public GeoDistanceAggregation addRanges(Range<Double>... ranges)
Add the given ranges to the aggregation.- Parameters:
ranges
- the ranges.- Returns:
- the aggregation.
- Since:
- 9.0.0
-
addRanges
public GeoDistanceAggregation addRanges(Collection<Range<Double>> ranges)
Add the given ranges to the aggregation.- Parameters:
ranges
- the ranges.- Returns:
- the aggregation.
- Since:
- 9.0.0
-
getRanges
public List<Range<Double>> getRanges()
Returns the range list.- Returns:
- the range list.
- Since:
- 9.0.0
-
getField
public DocumentTypeField getField()
Description copied from interface:IFieldAwareAggregation
Returns the field this aggregation is bound to.- Specified by:
getField
in interfaceIFieldAwareAggregation
- Returns:
- the field this aggregation is bound to.
-
getPin
public GeoPoint getPin()
Returns the center point of the aggregation.- Returns:
- the center point of the aggregation.
- Since:
- 9.0.0
-
getId
public String getId()
Description copied from interface:IAggregation
Returns the aggregation identifier.- Specified by:
getId
in interfaceIAggregation
- Returns:
- the aggregation identifier.
-
-