diff options
Diffstat (limited to 'vendor/gopkg.in/olivere/elastic.v5/search_queries_geo_distance.go')
-rw-r--r-- | vendor/gopkg.in/olivere/elastic.v5/search_queries_geo_distance.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/vendor/gopkg.in/olivere/elastic.v5/search_queries_geo_distance.go b/vendor/gopkg.in/olivere/elastic.v5/search_queries_geo_distance.go index 00e62725f..a10bd5e3c 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/search_queries_geo_distance.go +++ b/vendor/gopkg.in/olivere/elastic.v5/search_queries_geo_distance.go @@ -8,7 +8,7 @@ package elastic // within a specific distance from a geo point. // // For more details, see: -// https://www.elastic.co/guide/en/elasticsearch/reference/6.0/query-dsl-geo-distance-query.html +// https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-geo-distance-query.html type GeoDistanceQuery struct { name string distance string @@ -16,6 +16,7 @@ type GeoDistanceQuery struct { lon float64 geohash string distanceType string + optimizeBbox string queryName string } @@ -61,6 +62,11 @@ func (q *GeoDistanceQuery) DistanceType(distanceType string) *GeoDistanceQuery { return q } +func (q *GeoDistanceQuery) OptimizeBbox(optimizeBbox string) *GeoDistanceQuery { + q.optimizeBbox = optimizeBbox + return q +} + func (q *GeoDistanceQuery) QueryName(queryName string) *GeoDistanceQuery { q.queryName = queryName return q @@ -97,6 +103,9 @@ func (q *GeoDistanceQuery) Source() (interface{}, error) { if q.distanceType != "" { params["distance_type"] = q.distanceType } + if q.optimizeBbox != "" { + params["optimize_bbox"] = q.optimizeBbox + } if q.queryName != "" { params["_name"] = q.queryName } |