Skip to content

Commit

Permalink
Change geo_bbox to geo_bounding_box
Browse files Browse the repository at this point in the history
Close #506
  • Loading branch information
olivere committed Apr 10, 2017
1 parent 3b39012 commit 122fc1c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions search_queries_geo_bounding_box.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" : {
// ...
// }
// }
Expand All @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions search_queries_geo_bounding_box_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand Down

0 comments on commit 122fc1c

Please sign in to comment.