Class: Couchbase::SearchQuery::GeoPolygonQuery
- Inherits:
-
SearchQuery
- Object
- SearchQuery
- Couchbase::SearchQuery::GeoPolygonQuery
- Defined in:
- lib/couchbase/search_options.rb,
/home/runner/work/couchbase-ruby-client/couchbase-ruby-client/lib/couchbase/search_options.rb
Overview
A search query which allows to match inside a geo polygon.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(coordinates) {|self| ... } ⇒ GeoPolygonQuery
constructor
A new instance of GeoPolygonQuery.
- #to_h ⇒ Hash<Symbol, #to_json>
Constructor Details
#initialize(coordinates) {|self| ... } ⇒ GeoPolygonQuery
Returns a new instance of GeoPolygonQuery.
704 705 706 707 708 |
# File 'lib/couchbase/search_options.rb', line 704 def initialize(coordinates) super() @coordinates = coordinates yield self if block_given? end |
Instance Attribute Details
#boost ⇒ Float
696 697 698 |
# File 'lib/couchbase/search_options.rb', line 696 def boost @boost end |
#field ⇒ String
699 700 701 |
# File 'lib/couchbase/search_options.rb', line 699 def field @field end |
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
711 712 713 714 715 716 717 718 |
# File 'lib/couchbase/search_options.rb', line 711 def to_h data = { :polygon_points => @coordinates.map { |coord| [coord.longitude, coord.latitude] }, } data[:boost] = boost if boost data[:field] = field if field data end |