123456789_123456789_123456789_123456789_123456789_

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

Relationships & Source Files
Inherits: Object
Defined in: lib/redis/commands/modules/search/hybrid.rb

Overview

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

Class Method Summary

Instance Attribute Summary

Constructor Details

.new(field, asc: true) ⇒ SortbyField

Parameters:

  • field (String)

    the field to sort by

  • asc (Boolean)

    sort ascending when true, descending otherwise

[ GitHub ]

  
# 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:

  • (Array<String>)

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

[ GitHub ]

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

attr_reader :args