123456789_123456789_123456789_123456789_123456789_

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

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

Overview

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

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(cid) ⇒ Cursor

Parameters:

  • cid (Integer)

    the cursor id returned by a prior aggregation

[ GitHub ]

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

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

Instance Attribute Details

#cidInteger (rw)

Returns:

  • (Integer)

    the cursor id

  • (Integer)

    the COUNT (batch size, 0 to omit)

[ GitHub ]

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

attr_accessor :cid, :count

#countInteger (rw)

Returns:

  • (Integer)

    the cursor id

  • (Integer)

    the COUNT (batch size, 0 to omit)

[ GitHub ]

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

attr_accessor :cid, :count

Instance Method Details

#build_argsArray<String>

Render the cursor arguments for FT.CURSOR READ.

Returns:

  • (Array<String>)

    the argument token array

[ GitHub ]

  
# 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