Skip to content

Commit e881dc2

Browse files
committed
[DOCS] Warn about using geo_centroid as sub-agg to geohash_grid (#50038)
If `geo_point fields` are multi-valued, using `geo_centroid` as a sub-agg to `geohash_grid` could result in centroids outside of bucket boundaries. This adds a related warning to the geo_centroid agg docs.
1 parent 80c3da6 commit e881dc2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/reference/aggregations/metrics/geocentroid-aggregation.asciidoc

+14
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,17 @@ The response for the above aggregation:
143143
}
144144
--------------------------------------------------
145145
// TESTRESPONSE[s/\.\.\./"took": $body.took,"_shards": $body._shards,"hits":$body.hits,"timed_out":false,/]
146+
147+
[WARNING]
148+
.Using `geo_centroid` as a sub-aggregation of `geohash_grid`
149+
====
150+
The <<search-aggregations-bucket-geohashgrid-aggregation,`geohash_grid`>>
151+
aggregation places documents, not individual geo-points, into buckets. If a
152+
document's `geo_point` field contains <<array,multiple values>>, the document
153+
could be assigned to multiple buckets, even if one or more of its geo-points are
154+
outside the bucket boundaries.
155+
156+
If a `geocentroid` sub-aggregation is also used, each centroid is calculated
157+
using all geo-points in a bucket, including those outside the bucket boundaries.
158+
This can result in centroids outside of bucket boundaries.
159+
====

0 commit comments

Comments
 (0)