Class: Couchbase::Cluster::SearchQuery::GeoDistanceQuery
Overview
Finds ‘geopoint` indexed matches around a point with the given distance.
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(longitude, latitude, distance) {|self| ... } ⇒ GeoDistanceQuery
Returns a new instance of GeoDistanceQuery.
[View source]
569
570
571
572
573
574
575
|
# File 'lib/couchbase/search_options.rb', line 569
def initialize(longitude, latitude, distance)
super()
@longitude = longitude
@latitude = latitude
@distance = distance
yield self if block_given?
end
|
Instance Attribute Details
#boost ⇒ Float
557
558
559
|
# File 'lib/couchbase/search_options.rb', line 557
def boost
@boost
end
|
#field ⇒ String
563
564
565
|
# File 'lib/couchbase/search_options.rb', line 563
def field
@field
end
|
#operator ⇒ nil, ...
560
561
562
|
# File 'lib/couchbase/search_options.rb', line 560
def operator
@operator
end
|
Instance Method Details
#to_json(*args) ⇒ String
[View source]
578
579
580
581
582
583
584
585
586
587
|
# File 'lib/couchbase/search_options.rb', line 578
def to_json(*args)
data = {
"location" => [@longitude, @latitude],
"distance" => @distance,
}
data["boost"] = boost if boost
data["operator"] = operator.to_s if operator
data["field"] = field if field
data.to_json(*args)
end
|