Class: Redis::Commands::Search::SortbyField

Inherits:
Object
  • Object
show all
Defined in:
lib/redis/commands/modules/search/hybrid.rb

Overview

A single field/direction pair for hybrid-search SORTBY.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field, asc: true) ⇒ SortbyField

Returns a new instance of SortbyField.

Parameters:

  • field (String) —

    the field to sort by

  • asc (Boolean) (defaults to: true) —

    sort ascending when true, descending otherwise



356
357
358
# File 'lib/redis/commands/modules/search/hybrid.rb', line 356

def initialize(field, asc: true)
  @args = [field, asc ? "ASC" : "DESC"]
end

Instance Attribute Details

#args ⇒ Array<String> (readonly)

Returns the argument tokens, [field, "ASC"|"DESC"].

Returns:

  • (Array<String>) —

    the argument tokens, [field, "ASC"|"DESC"]



352
353
354
# File 'lib/redis/commands/modules/search/hybrid.rb', line 352

def args
  @args
end