123456789_123456789_123456789_123456789_123456789_

Class: Redis::Commands::Search::HybridCursorQuery

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

Overview

The WITHCURSOR clause for paging through FT.HYBRID results.

Class Method Summary

Instance Method Summary

Constructor Details

.new(count: 0, max_idle: 0) ⇒ HybridCursorQuery

Parameters:

  • count (Integer)

    the cursor COUNT (batch size, 0 to omit)

  • max_idle (Integer)

    the cursor MAXIDLE in milliseconds (0 to omit)

[ GitHub ]

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

def initialize(count: 0, max_idle: 0)
  @count = count
  @max_idle = max_idle
end

Instance Method Details

#build_argsArray<String>

Render the cursor arguments.

Returns:

  • (Array<String>)

    the argument tokens, beginning with "WITHCURSOR"

[ GitHub ]

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

def build_args
  args = ["WITHCURSOR"]
  args.concat(["COUNT", @count.to_s]) if @count > 0
  args.concat(["MAXIDLE", @max_idle.to_s]) if @max_idle > 0
  args
end