Method: Sunspot::DSL::Query#near

Defined in:
lib/sunspot/dsl/query.rb

#near(coordinates, miles) ⇒ Object

Scope the search by geographical distance from a given point. coordinates should either respond to #first and #last (e.g. a two-element array), or to #lat and one of #lng, #lon, or #long. miles is the radius around the point for which to return documents.



106
107
108
# File 'lib/sunspot/dsl/query.rb', line 106

def near(coordinates, miles)
  @query.add_location_restriction(coordinates, miles)
end