Class: Redis::Commands::Search::Cursor

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

Overview

Represents an FT.CURSOR read for paging through aggregation results.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cid) ⇒ Cursor

Returns a new instance of Cursor.

Parameters:

  • cid (Integer)

    the cursor id returned by a prior aggregation



402
403
404
405
# File 'lib/redis/commands/modules/search/aggregation.rb', line 402

def initialize(cid)
  @cid = cid
  @count = 0
end

Instance Attribute Details

#cidInteger

Returns:

  • (Integer)

    the cursor id

  • (Integer)

    the COUNT (batch size, 0 to omit)



399
400
401
# File 'lib/redis/commands/modules/search/aggregation.rb', line 399

def cid
  @cid
end

#countInteger

Returns:

  • (Integer)

    the cursor id

  • (Integer)

    the COUNT (batch size, 0 to omit)



399
400
401
# File 'lib/redis/commands/modules/search/aggregation.rb', line 399

def count
  @count
end

Instance Method Details

#build_argsArray<String>

Render the cursor arguments for FT.CURSOR READ.

Returns:

  • (Array<String>)

    the argument token array



410
411
412
413
414
# File 'lib/redis/commands/modules/search/aggregation.rb', line 410

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