mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
* Removed the docs for `index.compound_format` and `index.compound_on_flush` - these are expert settings which should probably be removed (see https://github.com/elastic/elasticsearch/issues/10778) * Removed the docs for `index.index_concurrency` - another expert setting * Labelled the segments verbose output as experimental * Marked the `compression`, `precision_threshold` and `rehash` options as experimental in the cardinality and percentile aggs * Improved the experimental text on `significant_terms`, `execution_hint` in the terms agg, and `terminate_after` param on count and search * Removed the experimental flag on the `geobounds` agg * Marked the settings in the `merge` and `store` modules as experimental, rather than the modules themselves Closes #10782
54 lines
1.4 KiB
Plaintext
54 lines
1.4 KiB
Plaintext
[[search-aggregations-metrics-geobounds-aggregation]]
|
|
=== Geo Bounds Aggregation
|
|
|
|
A metric aggregation that computes the bounding box containing all geo_point values for a field.
|
|
|
|
|
|
Example:
|
|
|
|
[source,js]
|
|
--------------------------------------------------
|
|
{
|
|
"query" : {
|
|
"match" : { "business_type" : "shop" }
|
|
},
|
|
"aggs" : {
|
|
"viewport" : {
|
|
"geo_bounds" : {
|
|
"field" : "location", <1>
|
|
"wrap_longitude" : true <2>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
|
|
<1> The `geo_bounds` aggregation specifies the field to use to obtain the bounds
|
|
<2> `wrap_longitude` is an optional parameter which specifies whether the bounding box should be allowed to overlap the international date line. The default value is `true`
|
|
|
|
The above aggregation demonstrates how one would compute the bounding box of the location field for all documents with a business type of shop
|
|
|
|
The response for the above aggregation:
|
|
|
|
[source,js]
|
|
--------------------------------------------------
|
|
{
|
|
...
|
|
|
|
"aggregations": {
|
|
"viewport": {
|
|
"bounds": {
|
|
"top_left": {
|
|
"lat": 80.45,
|
|
"lon": -160.22
|
|
},
|
|
"bottom_right": {
|
|
"lat": 40.65,
|
|
"lon": 42.57
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
--------------------------------------------------
|