class Sunspot::Query::Geo

Constants

DEFAULT_PRECISION
DEFAULT_PRECISION_FACTOR
MAX_PRECISION

Public Instance Methods

to_params() click to toggle source
# File lib/sunspot/query/geo.rb, line 19
def to_params
  { :q => to_boolean_query }
end
to_subquery() click to toggle source
# File lib/sunspot/query/geo.rb, line 23
def to_subquery
  { :q => "(#{to_boolean_query})" }
end

Public Class Methods

new(field, lat, lng, options) click to toggle source
# File lib/sunspot/query/geo.rb, line 14
def initialize(field, lat, lng, options)
  @field, @options = field, options
  @geohash = GeoHash.encode(lat.to_f, lng.to_f, MAX_PRECISION)
end