1+ using System . ComponentModel ;
12using NRedisStack . Search ;
3+ using NRedisStack . Search . Aggregation ;
24using NRedisStack . Search . DataTypes ;
35using StackExchange . Redis ;
46
@@ -18,11 +20,20 @@ public interface ISearchCommands
1820 /// Run a search query on an index, and perform aggregate transformations on the results.
1921 /// </summary>
2022 /// <param name="index">The index name.</param>
21- /// <param name="query">The query</param>
23+ /// <param name="query">The query. </param>
2224 /// <returns>An <see langword="AggregationResult"/> object</returns>
2325 /// <remarks><seealso href="https://redis.io/commands/ft.aggregate"/></remarks>
2426 AggregationResult Aggregate ( string index , AggregationRequest query ) ;
2527
28+ /// <summary>
29+ /// Run a search query on an index, and perform aggregate transformations on the results.
30+ /// </summary>
31+ /// <param name="index">The index name.</param>
32+ /// <param name="query">The query.</param>
33+ /// <returns>A sequence of <see langword="Row"/> values.</returns>
34+ /// <remarks><seealso href="https://redis.io/commands/ft.aggregate"/></remarks>
35+ IEnumerable < Row > AggregateEnumerable ( string index , AggregationRequest query ) ;
36+
2637 /// <summary>
2738 /// Add an alias to an index.
2839 /// </summary>
@@ -92,22 +103,43 @@ public interface ISearchCommands
92103 /// <summary>
93104 /// Delete a cursor from the index.
94105 /// </summary>
95- /// <param name="indexName">The index name</param>
106+ /// <param name="indexName">The index name. </param>
96107 /// <param name="cursorId">The cursor's ID.</param>
97108 /// <returns><see langword="true"/> if it has been deleted, <see langword="false"/> if it did not exist.</returns>
98109 /// <remarks><seealso href="https://redis.io/commands/ft.cursor-del/"/></remarks>
110+ [ Obsolete ( "When possible, use CursorDel(AggregationResult) instead." ) ]
111+ [ Browsable ( false ) , EditorBrowsable ( EditorBrowsableState . Never ) ]
99112 bool CursorDel ( string indexName , long cursorId ) ;
113+
114+ /// <summary>
115+ /// Delete a cursor from the index.
116+ /// </summary>
117+ /// <param name="result">The result of a previous call to Aggregate or CursorRead.</param>
118+ /// <returns><see langword="true"/> if it has been deleted, <see langword="false"/> if it did not exist.</returns>
119+ /// <remarks><seealso href="https://redis.io/commands/ft.cursor-del/"/></remarks>
120+ bool CursorDel ( AggregationResult result ) ;
100121
101122 /// <summary>
102123 /// Read next results from an existing cursor.
103124 /// </summary>
104- /// <param name="indexName">The index name</param>
125+ /// <param name="indexName">The index name. </param>
105126 /// <param name="cursorId">The cursor's ID.</param>
106127 /// <param name="count">Limit the amount of returned results.</param>
107128 /// <returns>A AggregationResult object with the results</returns>
108129 /// <remarks><seealso href="https://redis.io/commands/ft.cursor-read/"/></remarks>
130+ [ Obsolete ( "When possible, use AggregateEnumerable or CursorRead(AggregationResult, int?) instead." ) ]
131+ [ Browsable ( false ) , EditorBrowsable ( EditorBrowsableState . Never ) ]
109132 AggregationResult CursorRead ( string indexName , long cursorId , int ? count = null ) ;
110133
134+ /// <summary>
135+ /// Read next results from an existing cursor.
136+ /// </summary>
137+ /// <param name="result">The result of a previous call to Aggregate or CursorRead.</param>
138+ /// <param name="count">Limit the amount of returned results.</param>
139+ /// <returns>A AggregationResult object with the results</returns>
140+ /// <remarks><seealso href="https://redis.io/commands/ft.cursor-read/"/></remarks>
141+ public AggregationResult CursorRead ( AggregationResult result , int ? count = null ) ;
142+
111143 /// <summary>
112144 /// Add terms to a dictionary.
113145 /// </summary>
0 commit comments