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



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

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

Instance Attribute Details

#argsArray<String> (readonly)

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

Returns:

  • (Array<String>)

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



349
350
351
# File 'lib/redis/commands/modules/search/hybrid.rb', line 349

def args
  @args
end