Class: Couchbase::SearchSort::SearchSortScore

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Couchbase::SearchSort

field, geo_distance, id, score

Constructor Details

#initialize {|| ... } ⇒ SearchSortScore

Returns a new instance of SearchSortScore.

Yield Parameters:



1170
1171
1172
1173
# File 'lib/couchbase/search_options.rb', line 1170

def initialize
  super
  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



1167
1168
1169
# File 'lib/couchbase/search_options.rb', line 1167

def desc
  @desc
end

Instance Method Details

#to_json(*args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



1176
1177
1178
# File 'lib/couchbase/search_options.rb', line 1176

def to_json(*args)
  {by: :score, desc: desc}.to_json(*args)
end