Class: Couchbase::Cluster::SearchQuery::GeoBoundingBoxQuery

Inherits:
Couchbase::Cluster::SearchQuery show all
Defined in:
lib/couchbase/search_options.rb

Overview

Finds `geopoint` indexed matches in a given bounding box.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Couchbase::Cluster::SearchQuery

boolean_field, booleans, conjuncts, date_range, disjuncts, doc_id, geo_bounding_box, geo_distance, match, match_all, match_none, match_phrase, numeric_range, phrase, prefix, query_string, regexp, term, term_range, wildcard

Constructor Details

#initialize(top_left_longitude, top_left_latitude, bottom_right_longitude, bottom_right_latitude) {|self| ... } ⇒ GeoBoundingBoxQuery

Returns a new instance of GeoBoundingBoxQuery.

Parameters:

  • top_left_longitude (Float)
  • top_left_latitude (Float)
  • bottom_right_longitude (Float)
  • bottom_right_latitude (Float)

Yield Parameters:

[View source]

580
581
582
583
584
585
586
587
# File 'lib/couchbase/search_options.rb', line 580

def initialize(top_left_longitude, top_left_latitude, bottom_right_longitude, bottom_right_latitude)
  super()
  @top_left_longitude = top_left_longitude
  @top_left_latitude = top_left_latitude
  @bottom_right_longitude = bottom_right_longitude
  @bottom_right_latitude = bottom_right_latitude
  yield self if block_given?
end

Instance Attribute Details

#boostFloat

Returns:

  • (Float)

569
570
571
# File 'lib/couchbase/search_options.rb', line 569

def boost
  @boost
end

#fieldString

Returns:

  • (String)

572
573
574
# File 'lib/couchbase/search_options.rb', line 572

def field
  @field
end

Instance Method Details

#to_json(*args) ⇒ String

Returns:

  • (String)
[View source]

590
591
592
593
594
595
596
597
598
# File 'lib/couchbase/search_options.rb', line 590

def to_json(*args)
  data = {
      "top_left" => [@top_left_longitude, @top_left_latitude],
      "bottom_right" => [@bottom_right_longitude, @bottom_right_latitude]
  }
  data["boost"] = boost if boost
  data["field"] = field if field
  data.to_json(*args)
end