From 122fc1c3f9d7777f16243ba11cfe048749a629a7 Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Mon, 10 Apr 2017 10:14:07 +0200 Subject: [PATCH] Change geo_bbox to geo_bounding_box Close #506 --- CONTRIBUTORS | 1 + search_queries_geo_bounding_box.go | 4 ++-- search_queries_geo_bounding_box_test.go | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index d8b9c1645..55c50db41 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -38,6 +38,7 @@ Guillaume J. Charmes [@creack](https://github.com/creack) Guiseppe [@gm42](https://github.com/gm42) Han Yu [@MoonighT](https://github.com/MoonighT) Harrison Wright [@wright8191](https://github.com/wright8191) +Henry Clifford [@hcliff](https://github.com/hcliff) Igor Dubinskiy [@idubinskiy](https://github.com/idubinskiy) initialcontext [@initialcontext](https://github.com/initialcontext) Isaac Saldana [@isaldana](https://github.com/isaldana) diff --git a/search_queries_geo_bounding_box.go b/search_queries_geo_bounding_box.go index 2b9cda746..e53340e64 100644 --- a/search_queries_geo_bounding_box.go +++ b/search_queries_geo_bounding_box.go @@ -83,7 +83,7 @@ func (q *GeoBoundingBoxQuery) QueryName(queryName string) *GeoBoundingBoxQuery { // Source returns JSON for the function score query. func (q *GeoBoundingBoxQuery) Source() (interface{}, error) { // { - // "geo_bbox" : { + // "geo_bounding_box" : { // ... // } // } @@ -103,7 +103,7 @@ func (q *GeoBoundingBoxQuery) Source() (interface{}, error) { source := make(map[string]interface{}) params := make(map[string]interface{}) - source["geo_bbox"] = params + source["geo_bounding_box"] = params box := make(map[string]interface{}) box["top_left"] = []float64{*q.left, *q.top} diff --git a/search_queries_geo_bounding_box_test.go b/search_queries_geo_bounding_box_test.go index 59cd437d5..f44a2364f 100644 --- a/search_queries_geo_bounding_box_test.go +++ b/search_queries_geo_bounding_box_test.go @@ -37,7 +37,7 @@ func TestGeoBoundingBoxQuery(t *testing.T) { t.Fatalf("marshaling to JSON failed: %v", err) } got := string(data) - expected := `{"geo_bbox":{"pin.location":{"bottom_right":[-71.12,40.01],"top_left":[-74.1,40.73]},"type":"memory"}}` + expected := `{"geo_bounding_box":{"pin.location":{"bottom_right":[-71.12,40.01],"top_left":[-74.1,40.73]},"type":"memory"}}` if got != expected { t.Errorf("expected\n%s\n,got:\n%s", expected, got) } @@ -56,7 +56,7 @@ func TestGeoBoundingBoxQueryWithGeoPoint(t *testing.T) { t.Fatalf("marshaling to JSON failed: %v", err) } got := string(data) - expected := `{"geo_bbox":{"pin.location":{"bottom_right":[-71.12,40.01],"top_left":[-74.1,40.73]}}}` + expected := `{"geo_bounding_box":{"pin.location":{"bottom_right":[-71.12,40.01],"top_left":[-74.1,40.73]}}}` if got != expected { t.Errorf("expected\n%s\n,got:\n%s", expected, got) }