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

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

Overview

The WITHCURSOR clause for paging through FT.HYBRID results.

Instance Method Summary collapse

Constructor Details

#initialize(count: 0, max_idle: 0) ⇒ HybridCursorQuery

Returns a new instance of HybridCursorQuery.

Parameters:

  • count (Integer) (defaults to: 0)

    the cursor COUNT (batch size, 0 to omit)

  • max_idle (Integer) (defaults to: 0)

    the cursor MAXIDLE in milliseconds (0 to omit)



330
331
332
333
# 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"



338
339
340
341
342
343
# 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