diff --git a/README.md b/README.md index 69efa19..c84b93f 100644 --- a/README.md +++ b/README.md @@ -939,7 +939,7 @@ Restaurant.search "sushi", where: {location: {top_left: {lat: 38, lon: -123}, bo Bounded by a polygon ```ruby -Restaurant.search "dessert", where: {location: {geo_shape: {type: "polygon", coordinates: [[{lat: 38, lon: -123}, {lat: 39, lon: -123}, {lat: 37, lon: 122}, {lat: 38, lon: -123}]]}}} +Restaurant.search "dessert", where: {location: {geo_polygon: {points: [{lat: 38, lon: -123}, {lat: 39, lon: -123}, {lat: 37, lon: 122}]}}} ``` ### Boost By Distance diff --git a/test/where_test.rb b/test/where_test.rb index 5d9d43b..3060673 100644 --- a/test/where_test.rb +++ b/test/where_test.rb @@ -298,9 +298,12 @@ class WhereTest < Minitest::Test assert_match "Deprecated field [geo_polygon] used", stderr end - # see test/geo_shape_test.rb for other geo_shape tests - polygon << polygon.first - assert_search "san", ["San Francisco", "San Antonio"], where: {location: {geo_shape: {type: "polygon", coordinates: [polygon]}}} + # Field [location] is not of type [geo_shape] but of type [geo_point] error for previous versions + unless Searchkick.server_below?("7.14.0") + polygon << polygon.first + # see test/geo_shape_test.rb for other geo_shape tests + assert_search "san", ["San Francisco", "San Antonio"], where: {location: {geo_shape: {type: "polygon", coordinates: [polygon]}}} + end end def test_top_left_bottom_right -- libgit2 0.21.0