mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 02:23:28 +08:00
Elasticsearch: Unify default value for geo hash grid precision across the code to 3 (#73922)
* Unify default value * Use variable to keep default precisions in sync * Use default precision variable * Update precision description * Update defaultPrecisionString and move * Be more specific in naming of variabkle * Revert "Merge remote-tracking branch 'origin' into ivana/es-precision-default-value" This reverts commit 599f236a7717315a43434b88b50aea2fdfb502e3, reversing changes made to 6742be0c6de6b735cf4a0b82143bc628a7622d87. * Revert wrong merge * Revert wrong merge with turned off lefthook
This commit is contained in:
@ -9,6 +9,7 @@ const (
|
||||
HighlightPreTagsString = "@HIGHLIGHT@"
|
||||
HighlightPostTagsString = "@/HIGHLIGHT@"
|
||||
HighlightFragmentSize = 2147483647
|
||||
DefaultGeoHashPrecision = 3
|
||||
)
|
||||
|
||||
// SearchRequestBuilder represents a builder which can build a search request
|
||||
@ -452,7 +453,7 @@ func (b *aggBuilderImpl) Filters(key string, fn func(a *FiltersAggregation, b Ag
|
||||
func (b *aggBuilderImpl) GeoHashGrid(key, field string, fn func(a *GeoHashGridAggregation, b AggBuilder)) AggBuilder {
|
||||
innerAgg := &GeoHashGridAggregation{
|
||||
Field: field,
|
||||
Precision: 5,
|
||||
Precision: DefaultGeoHashPrecision,
|
||||
}
|
||||
aggDef := newAggDef(key, &aggContainer{
|
||||
Type: "geohash_grid",
|
||||
|
@ -269,7 +269,7 @@ func addFiltersAgg(aggBuilder es.AggBuilder, bucketAgg *BucketAgg) es.AggBuilder
|
||||
|
||||
func addGeoHashGridAgg(aggBuilder es.AggBuilder, bucketAgg *BucketAgg) es.AggBuilder {
|
||||
aggBuilder.GeoHashGrid(bucketAgg.ID, bucketAgg.Field, func(a *es.GeoHashGridAggregation, b es.AggBuilder) {
|
||||
a.Precision = stringToIntWithDefaultValue(bucketAgg.Settings.Get("precision").MustString(), 3)
|
||||
a.Precision = stringToIntWithDefaultValue(bucketAgg.Settings.Get("precision").MustString(), es.DefaultGeoHashPrecision)
|
||||
aggBuilder = b
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user