Class: Couchbase::SearchQuery::GeoDistanceQuery
- Inherits:
-
SearchQuery
- Object
- SearchQuery
- Couchbase::SearchQuery::GeoDistanceQuery
- Defined in:
- lib/couchbase/search_options.rb,
/home/runner/work/couchbase-ruby-client/couchbase-ruby-client/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.
594 595 596 597 598 599 600 |
# File 'lib/couchbase/search_options.rb', line 594 def initialize(longitude, latitude, distance) super() @longitude = longitude @latitude = latitude @distance = distance yield self if block_given? end |
Instance Attribute Details
#boost ⇒ Float
585 586 587 |
# File 'lib/couchbase/search_options.rb', line 585 def boost @boost end |
#field ⇒ String
588 589 590 |
# File 'lib/couchbase/search_options.rb', line 588 def field @field end |
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
603 604 605 606 607 608 609 610 611 |
# File 'lib/couchbase/search_options.rb', line 603 def to_h data = { :location => [@longitude, @latitude], :distance => @distance, } data[:boost] = boost if boost data[:field] = field if field data end |