1
+ using System . ComponentModel ;
1
2
using NRedisStack . Search ;
3
+ using NRedisStack . Search . Aggregation ;
2
4
using NRedisStack . Search . DataTypes ;
3
5
using StackExchange . Redis ;
4
6
@@ -18,11 +20,20 @@ public interface ISearchCommands
18
20
/// Run a search query on an index, and perform aggregate transformations on the results.
19
21
/// </summary>
20
22
/// <param name="index">The index name.</param>
21
- /// <param name="query">The query</param>
23
+ /// <param name="query">The query. </param>
22
24
/// <returns>An <see langword="AggregationResult"/> object</returns>
23
25
/// <remarks><seealso href="https://redis.io/commands/ft.aggregate"/></remarks>
24
26
AggregationResult Aggregate ( string index , AggregationRequest query ) ;
25
27
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
+
26
37
/// <summary>
27
38
/// Add an alias to an index.
28
39
/// </summary>
@@ -92,22 +103,43 @@ public interface ISearchCommands
92
103
/// <summary>
93
104
/// Delete a cursor from the index.
94
105
/// </summary>
95
- /// <param name="indexName">The index name</param>
106
+ /// <param name="indexName">The index name. </param>
96
107
/// <param name="cursorId">The cursor's ID.</param>
97
108
/// <returns><see langword="true"/> if it has been deleted, <see langword="false"/> if it did not exist.</returns>
98
109
/// <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 ) ]
99
112
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 ) ;
100
121
101
122
/// <summary>
102
123
/// Read next results from an existing cursor.
103
124
/// </summary>
104
- /// <param name="indexName">The index name</param>
125
+ /// <param name="indexName">The index name. </param>
105
126
/// <param name="cursorId">The cursor's ID.</param>
106
127
/// <param name="count">Limit the amount of returned results.</param>
107
128
/// <returns>A AggregationResult object with the results</returns>
108
129
/// <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 ) ]
109
132
AggregationResult CursorRead ( string indexName , long cursorId , int ? count = null ) ;
110
133
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
+
111
143
/// <summary>
112
144
/// Add terms to a dictionary.
113
145
/// </summary>
0 commit comments