summaryrefslogtreecommitdiffstats
path: root/vendor/gopkg.in/olivere/elastic.v5/search_queries_geo_distance.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-04-16 05:37:14 -0700
committerJoram Wilander <jwawilander@gmail.com>2018-04-16 08:37:14 -0400
commit6e2cb00008cbf09e556b00f87603797fcaa47e09 (patch)
tree3c0eb55ff4226a3f024aad373140d1fb860a6404 /vendor/gopkg.in/olivere/elastic.v5/search_queries_geo_distance.go
parentbf24f51c4e1cc6286885460672f7f449e8c6f5ef (diff)
downloadchat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.gz
chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.bz2
chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.zip
Depenancy upgrades and movign to dep. (#8630)
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.go11
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
}