K - the type of keys used in the aggregation resultsV - the type of values used in the aggregation resultspublic class AggregationReply<K,V> extends Object
An aggregation reply contains:
SearchReply objects, each representing an aggregation group or result setAggregation operations can include:
For cursor-based pagination, when the result set is too large to return in a single response, Redis returns a cursor ID that can be used with FT.CURSOR READ to retrieve subsequent pages.
SearchReply| Modifier and Type | Class and Description |
|---|---|
static class |
AggregationReply.Cursor
Lightweight cursor handle containing the server-assigned cursor id and optional node id (cluster sticky routing).
|
| Constructor and Description |
|---|
AggregationReply()
Creates a new empty AggregationReply.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getAggregationGroups()
Returns the number of aggregation groups in this reply.
|
Optional<AggregationReply.Cursor> |
getCursor()
Returns the optional Cursor metadata for pagination and (in cluster) sticky routing, if applicable.
|
List<SearchReply<K,V>> |
getReplies()
Returns the list of search replies containing the aggregation results.
|
void |
setCursor(AggregationReply.Cursor cursor)
Set the
AggregationReply.Cursor metadata carried by this reply. |
public AggregationReply()
public long getAggregationGroups()
This value represents:
Note: This count may be different from getReplies().size() in some cases, particularly when dealing with
cursor-based pagination where not all groups are returned in a single response.
public List<SearchReply<K,V>> getReplies()
Each SearchReply in the list represents:
The structure of each SearchReply depends on the aggregation operations performed:
The returned list is mutable and reflects the current state of the aggregation results. Modifying this list will affect the aggregation reply.
SearchReply objects containing the aggregation results. Never null, but may be
empty if no results were found.public Optional<AggregationReply.Cursor> getCursor()
When WITHCURSOR is used and Redis returns a cursor, this method yields a AggregationReply.Cursor containing the cursor id.
In cluster mode, the cursor may additionally carry the node id on which the cursor resides for sticky FT.CURSOR READ/DEL
routing.
Optional with AggregationReply.Cursor when a cursor was returned; otherwise an empty Optional.public void setCursor(AggregationReply.Cursor cursor)
AggregationReply.Cursor metadata carried by this reply. Intended for post-parse stamping of node affinity (cluster mode)
or attaching the server-returned cursor id (standalone).Copyright © 2025 lettuce.io. All rights reserved.