Class: Couchbase::SearchQuery::GeoDistanceQuery
- Inherits:
-
SearchQuery
- Object
- SearchQuery
- Couchbase::SearchQuery::GeoDistanceQuery
- Defined in:
- lib/couchbase/search_options.rb
Overview
Finds geopoint indexed matches around a point with the given distance.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(longitude, latitude, distance) {|self| ... } ⇒ GeoDistanceQuery
constructor
A new instance of GeoDistanceQuery.
- #to_h ⇒ Hash<Symbol, #to_json>
Constructor Details
#initialize(longitude, latitude, distance) {|self| ... } ⇒ GeoDistanceQuery
Returns a new instance of GeoDistanceQuery.
598 599 600 601 602 603 604 |
# File 'lib/couchbase/search_options.rb', line 598 def initialize(longitude, latitude, distance) super() @longitude = longitude @latitude = latitude @distance = distance yield self if block_given? end |
Instance Attribute Details
#boost ⇒ Float
589 590 591 |
# File 'lib/couchbase/search_options.rb', line 589 def boost @boost end |
#field ⇒ String
592 593 594 |
# File 'lib/couchbase/search_options.rb', line 592 def field @field end |
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
607 608 609 610 611 612 613 614 615 |
# File 'lib/couchbase/search_options.rb', line 607 def to_h data = { :location => [@longitude, @latitude], :distance => @distance, } data[:boost] = boost if boost data[:field] = field if field data end |