Class: Couchbase::Cluster::SearchQuery::GeoPolygonQuery
Overview
A search query which allows to match inside a geo polygon.
Instance Attribute Summary collapse
Instance Method Summary
collapse
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, wildcard
Constructor Details
#initialize(coordinates) {|self| ... } ⇒ GeoPolygonQuery
Returns a new instance of GeoPolygonQuery.
[View source]
687
688
689
690
691
|
# File 'lib/couchbase/search_options.rb', line 687
def initialize(coordinates)
super()
@coordinates = coordinates
yield self if block_given?
end
|
Instance Attribute Details
#boost ⇒ Float
676
677
678
|
# File 'lib/couchbase/search_options.rb', line 676
def boost
@boost
end
|
#field ⇒ String
682
683
684
|
# File 'lib/couchbase/search_options.rb', line 682
def field
@field
end
|
#operator ⇒ nil, ...
679
680
681
|
# File 'lib/couchbase/search_options.rb', line 679
def operator
@operator
end
|
Instance Method Details
#to_json(*args) ⇒ String
[View source]
694
695
696
697
698
699
700
701
702
|
# File 'lib/couchbase/search_options.rb', line 694
def to_json(*args)
data = {
"polygon_points" => @coordinates.map { |coord| [coord.longitude, coord.latitude] },
}
data["boost"] = boost if boost
data["operator"] = operator.to_s if operator
data["field"] = field if field
data.to_json(*args)
end
|