Class: Couchbase::SearchQuery::GeoBoundingBoxQuery
- Inherits:
-
SearchQuery
- Object
- SearchQuery
- Couchbase::SearchQuery::GeoBoundingBoxQuery
- 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 in a given bounding box.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(top_left_longitude, top_left_latitude, bottom_right_longitude, bottom_right_latitude) {|self| ... } ⇒ GeoBoundingBoxQuery
constructor
A new instance of GeoBoundingBoxQuery.
- #to_h ⇒ Hash<Symbol, #to_json>
Constructor Details
#initialize(top_left_longitude, top_left_latitude, bottom_right_longitude, bottom_right_latitude) {|self| ... } ⇒ GeoBoundingBoxQuery
Returns a new instance of GeoBoundingBoxQuery.
642 643 644 645 646 647 648 649 |
# File 'lib/couchbase/search_options.rb', line 642 def initialize(top_left_longitude, top_left_latitude, bottom_right_longitude, bottom_right_latitude) super() @top_left_longitude = top_left_longitude @top_left_latitude = top_left_latitude @bottom_right_longitude = bottom_right_longitude @bottom_right_latitude = bottom_right_latitude yield self if block_given? end |
Instance Attribute Details
#boost ⇒ Float
631 632 633 |
# File 'lib/couchbase/search_options.rb', line 631 def boost @boost end |
#field ⇒ String
634 635 636 |
# File 'lib/couchbase/search_options.rb', line 634 def field @field end |
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
652 653 654 655 656 657 658 659 660 |
# File 'lib/couchbase/search_options.rb', line 652 def to_h data = { :top_left => [@top_left_longitude, @top_left_latitude], :bottom_right => [@bottom_right_longitude, @bottom_right_latitude], } data[:boost] = boost if boost data[:field] = field if field data end |