Class: Couchbase::Cluster::SearchSort::SearchSortGeoDistance

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Couchbase::Cluster::SearchSort

field, geo_distance, id, score

Constructor Details

#initialize(field, longitude, latitude) {|| ... } ⇒ SearchSortGeoDistance

Returns a new instance of SearchSortGeoDistance.

Parameters:

  • field (String)

    field name

  • longitude (Float)
  • latitude (Float)

Yield Parameters:

[View source]

1034
1035
1036
1037
1038
1039
# File 'lib/couchbase/search_options.rb', line 1034

def initialize(field, longitude, latitude)
  @field = field
  @longitude = longitude
  @latitude = latitude
  yield self if block_given?
end

Instance Attribute Details

#descBoolean

Returns if descending order should be applied.

Returns:

  • (Boolean)

    if descending order should be applied


1019
1020
1021
# File 'lib/couchbase/search_options.rb', line 1019

def desc
  @desc
end

#fieldString (readonly)

Returns name of the field to sort by.

Returns:

  • (String)

    name of the field to sort by


1016
1017
1018
# File 'lib/couchbase/search_options.rb', line 1016

def field
  @field
end

#latitudeFloat (readonly)

Returns:

  • (Float)

1025
1026
1027
# File 'lib/couchbase/search_options.rb', line 1025

def latitude
  @latitude
end

#longitudeFloat (readonly)

Returns:

  • (Float)

1022
1023
1024
# File 'lib/couchbase/search_options.rb', line 1022

def longitude
  @longitude
end

#unit:meters, ...

Returns:

  • (:meters, :miles, :centimeters, :millimeters, :kilometers, :nauticalmiles, :feet, :yards, :inch)

1028
1029
1030
# File 'lib/couchbase/search_options.rb', line 1028

def unit
  @unit
end