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="17.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$ $Date$
- See Also:
Distance
,Range
,IMultiBucketAggregationResult
,IGeoDistanceAggregationResult
,GeoPoint
,SearchQuery.addAggregation(IAggregation)
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
id
-
Constructor Summary
Constructors Constructor Description GeoDistanceAggregation(java.lang.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(java.util.Collection<Range<java.lang.Double>> ranges)
Add the given ranges to the aggregation.GeoDistanceAggregation
addRanges(Range<java.lang.Double>... ranges)
Add the given ranges to the aggregation.DocumentTypeField
getField()
Returns the field this aggregation is bound to.java.lang.String
getId()
Returns the aggregation identifier.GeoPoint
getPin()
Returns the center point of the aggregation.java.util.List<Range<java.lang.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
-
-
-
-
Constructor Detail
-
GeoDistanceAggregation
public GeoDistanceAggregation(java.lang.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<java.lang.Double>... ranges)
Add the given ranges to the aggregation.- Parameters:
ranges
- the ranges.- Returns:
- the aggregation.
- Since:
- 9.0.0
-
addRanges
public GeoDistanceAggregation addRanges(java.util.Collection<Range<java.lang.Double>> ranges)
Add the given ranges to the aggregation.- Parameters:
ranges
- the ranges.- Returns:
- the aggregation.
- Since:
- 9.0.0
-
getRanges
public java.util.List<Range<java.lang.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 java.lang.String getId()
Description copied from interface:IAggregation
Returns the aggregation identifier.- Specified by:
getId
in interfaceIAggregation
- Returns:
- the aggregation identifier.
-
-