Class: Couchbase::Cluster::SearchSort::SearchSortField

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) {|| ... } ⇒ SearchSortField

Returns a new instance of SearchSortField.

Parameters:

  • field (String)

    the name of the filed for ordering

Yield Parameters:



1064
1065
1066
1067
1068
# File 'lib/couchbase/search_options.rb', line 1064

def initialize(field)
  super()
  @field = field
  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



1051
1052
1053
# File 'lib/couchbase/search_options.rb', line 1051

def desc
  @desc
end

#fieldString (readonly)

Returns name of the field to sort by.

Returns:

  • (String)

    name of the field to sort by



1048
1049
1050
# File 'lib/couchbase/search_options.rb', line 1048

def field
  @field
end

#missing:first, :last

Returns where the documents with missing field should be placed.

Returns:

  • (:first, :last)

    where the documents with missing field should be placed



1057
1058
1059
# File 'lib/couchbase/search_options.rb', line 1057

def missing
  @missing
end

#mode:default, ...

Returns:

  • (:default, :min, :max)


1060
1061
1062
# File 'lib/couchbase/search_options.rb', line 1060

def mode
  @mode
end

#type:auto, ...

Returns:

  • (:auto, :string, :number, :date)


1054
1055
1056
# File 'lib/couchbase/search_options.rb', line 1054

def type
  @type
end