Commit 79574478bee4f1e4f75026140e212bdf6376fb8f
1 parent
f6f6b16d
Exists in
master
and in
5 other branches
Updated readme and tests for deprecated geo_polygon filter
Showing
3 changed files
with
6 additions
and
2 deletions
Show diff stats
README.md
... | ... | @@ -939,7 +939,7 @@ Restaurant.search "sushi", where: {location: {top_left: {lat: 38, lon: -123}, bo |
939 | 939 | Bounded by a polygon |
940 | 940 | |
941 | 941 | ```ruby |
942 | -Restaurant.search "dessert", where: {location: {geo_polygon: {points: [{lat: 38, lon: -123}, {lat: 39, lon: -123}, {lat: 37, lon: 122}]}}} | |
942 | +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}]]}}} | |
943 | 943 | ``` |
944 | 944 | |
945 | 945 | ### Boost By Distance | ... | ... |
test/geo_shape_test.rb
test/where_test.rb
... | ... | @@ -297,6 +297,10 @@ class WhereTest < Minitest::Test |
297 | 297 | unless Searchkick.server_below?("7.12.0") |
298 | 298 | assert_match "Deprecated field [geo_polygon] used", stderr |
299 | 299 | end |
300 | + | |
301 | + # see test/geo_shape_test.rb for other geo_shape tests | |
302 | + polygon << polygon.first | |
303 | + assert_search "san", ["San Francisco", "San Antonio"], where: {location: {geo_shape: {type: "polygon", coordinates: [polygon]}}} | |
300 | 304 | end |
301 | 305 | |
302 | 306 | def test_top_left_bottom_right | ... | ... |