Browse Source

[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.
James Rodewig 5 years ago
parent
commit
7f35bcdfc9
1 changed files with 14 additions and 0 deletions
  1. 14 0
      docs/reference/aggregations/metrics/geocentroid-aggregation.asciidoc

+ 14 - 0
docs/reference/aggregations/metrics/geocentroid-aggregation.asciidoc

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