Commit e08567038f22023803b38a85dc89f8aff5a1a9a9

Authored by Andrew Kane
1 parent ed148fea

Updated readme [skip ci]

Showing 1 changed file with 7 additions and 7 deletions   Show diff stats
README.md
... ... @@ -877,7 +877,7 @@ Restaurant.search("pizza").where(location: {near: {lat: 37, lon: -114}, within:
877 877 Bounded by a box
878 878  
879 879 ```ruby
880   -Restaurant.search "sushi", where: {location: {top_left: {lat: 38, lon: -123}, bottom_right: {lat: 37, lon: -122}}}
  880 +Restaurant.search("sushi").where(location: {top_left: {lat: 38, lon: -123}, bottom_right: {lat: 37, lon: -122}})
881 881 ```
882 882  
883 883 **Note:** `top_right` and `bottom_left` also work
... ... @@ -885,7 +885,7 @@ Restaurant.search "sushi", where: {location: {top_left: {lat: 38, lon: -123}, bo
885 885 Bounded by a polygon
886 886  
887 887 ```ruby
888   -Restaurant.search "dessert", where: {location: {geo_polygon: {points: [{lat: 38, lon: -123}, {lat: 39, lon: -123}, {lat: 37, lon: 122}]}}}
  888 +Restaurant.search("dessert").where(location: {geo_polygon: {points: [{lat: 38, lon: -123}, {lat: 39, lon: -123}, {lat: 37, lon: 122}]}})
889 889 ```
890 890  
891 891 ### Boost By Distance
... ... @@ -893,13 +893,13 @@ Restaurant.search "dessert", where: {location: {geo_polygon: {points: [{lat: 38,
893 893 Boost results by distance - closer results are boosted more
894 894  
895 895 ```ruby
896   -Restaurant.search "noodles", boost_by_distance: {location: {origin: {lat: 37, lon: -122}}}
  896 +Restaurant.search("noodles").boost_by_distance(location: {origin: {lat: 37, lon: -122}})
897 897 ```
898 898  
899 899 Also supports [additional options](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_decay_functions)
900 900  
901 901 ```ruby
902   -Restaurant.search "wings", boost_by_distance: {location: {origin: {lat: 37, lon: -122}, function: "linear", scale: "30mi", decay: 0.5}}
  902 +Restaurant.search("wings").boost_by_distance(location: {origin: {lat: 37, lon: -122}, function: "linear", scale: "30mi", decay: 0.5})
903 903 ```
904 904  
905 905 ### Geo Shapes
... ... @@ -926,19 +926,19 @@ See the [Elasticsearch documentation](https://www.elastic.co/guide/en/elasticsea
926 926 Find shapes intersecting with the query shape
927 927  
928 928 ```ruby
929   -Restaurant.search "soup", where: {bounds: {geo_shape: {type: "polygon", coordinates: [[{lat: 38, lon: -123}, ...]]}}}
  929 +Restaurant.search("soup").where(bounds: {geo_shape: {type: "polygon", coordinates: [[{lat: 38, lon: -123}, ...]]}})
930 930 ```
931 931  
932 932 Falling entirely within the query shape
933 933  
934 934 ```ruby
935   -Restaurant.search "salad", where: {bounds: {geo_shape: {type: "circle", relation: "within", coordinates: [{lat: 38, lon: -123}], radius: "1km"}}}
  935 +Restaurant.search("salad").where(bounds: {geo_shape: {type: "circle", relation: "within", coordinates: [{lat: 38, lon: -123}], radius: "1km"}})
936 936 ```
937 937  
938 938 Not touching the query shape
939 939  
940 940 ```ruby
941   -Restaurant.search "burger", where: {bounds: {geo_shape: {type: "envelope", relation: "disjoint", coordinates: [{lat: 38, lon: -123}, {lat: 37, lon: -122}]}}}
  941 +Restaurant.search("burger").where(bounds: {geo_shape: {type: "envelope", relation: "disjoint", coordinates: [{lat: 38, lon: -123}, {lat: 37, lon: -122}]}})
942 942 ```
943 943  
944 944 ## Inheritance
... ...