Class: Couchbase::Cluster::SearchQuery::GeoDistanceQuery
- Inherits:
-
Couchbase::Cluster::SearchQuery
- Object
- Couchbase::Cluster::SearchQuery
- Couchbase::Cluster::SearchQuery::GeoDistanceQuery
- Defined in:
- lib/couchbase/search_options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/search_options.rb more...
Overview
Finds ‘geopoint` indexed matches around a point with the given distance.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(longitude, latitude, distance) {|self| ... } ⇒ GeoDistanceQuery
constructor
A new instance of GeoDistanceQuery.
- #to_h ⇒ Hash<Symbol, #to_json>
Methods inherited from Couchbase::Cluster::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(longitude, latitude, distance) {|self| ... } ⇒ GeoDistanceQuery
Returns a new instance of GeoDistanceQuery.
536 537 538 539 540 541 542 |
# File 'lib/couchbase/search_options.rb', line 536 def initialize(longitude, latitude, distance) super() @longitude = longitude @latitude = latitude @distance = distance yield self if block_given? end |
Instance Attribute Details
#boost ⇒ Float
527 528 529 |
# File 'lib/couchbase/search_options.rb', line 527 def boost @boost end |
#field ⇒ String
530 531 532 |
# File 'lib/couchbase/search_options.rb', line 530 def field @field end |
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
545 546 547 548 549 550 551 552 553 |
# File 'lib/couchbase/search_options.rb', line 545 def to_h data = { :location => [@longitude, @latitude], :distance => @distance, } data[:boost] = boost if boost data[:field] = field if field data end |