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| 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.
|
long |
getCursorId()
Returns the cursor ID for pagination, if applicable.
|
List<SearchReply<K,V>> |
getReplies()
Returns the list of search replies containing the aggregation results.
|
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 long getCursorId()
The cursor ID is used for paginating through large aggregation result sets that cannot be returned in a single response. When Redis returns a cursor ID, it indicates that there are more results available that can be retrieved using the FT.CURSOR READ command.
Cursor behavior:
To retrieve the next page of results, use the returned cursor ID with the FT.CURSOR READ command. Continue reading until the cursor ID becomes 0, indicating the end of the result set.
Note: Cursors have a timeout and will expire if not used within the configured time limit. Always check for cursor expiration when implementing pagination.
Copyright © 2025 lettuce.io. All rights reserved.