Class: Couchbase::SearchQuery::GeoPolygonQuery
- Inherits:
-
Couchbase::SearchQuery
- Object
- Couchbase::SearchQuery
- Couchbase::SearchQuery::GeoPolygonQuery
- Defined in:
- 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>
Methods inherited from Couchbase::SearchQuery
boolean_field, booleans, conjuncts, date_range, disjuncts, doc_id, geo_bounding_box, geo_distance, geo_polygon, match, match_all, match_none, match_phrase, numeric_range, phrase, prefix, query_string, regexp, term, term_range, #to_json, wildcard
Constructor Details
#initialize(coordinates) {|self| ... } ⇒ GeoPolygonQuery
Returns a new instance of GeoPolygonQuery.
706 707 708 709 710 |
# File 'lib/couchbase/search_options.rb', line 706 def initialize(coordinates) super() @coordinates = coordinates yield self if block_given? end |
Instance Attribute Details
#boost ⇒ Float
698 699 700 |
# File 'lib/couchbase/search_options.rb', line 698 def boost @boost end |
#field ⇒ String
701 702 703 |
# File 'lib/couchbase/search_options.rb', line 701 def field @field end |
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
713 714 715 716 717 718 719 720 |
# File 'lib/couchbase/search_options.rb', line 713 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 |