Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<SuppressTfmSupportBuildErrors>true</SuppressTfmSupportBuildErrors>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<NoWarn>$(NoWarn);CS1591;NRS003</NoWarn>
<IsWindows>$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::get_Windows())))</IsWindows>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!-- primary library -->
<PackageVersion Include="NetTopologySuite" Version="2.6.0" />
<PackageVersion Include="System.Text.Json" Version="10.0.10" />
<PackageVersion Include="StackExchange.Redis" Version="3.0.17" />
<PackageVersion Include="StackExchange.Redis" Version="3.0.25" />
Comment thread
mgravell marked this conversation as resolved.
<!-- tests, etc -->
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.6.2" />
<PackageVersion Include="coverlet.collector" Version="10.0.1" />
Expand Down
33 changes: 33 additions & 0 deletions docs/exp/NRS003.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
`REDUCE COLLECT` is gated behind the server's *unstable features* flag; the feature and its API may be subject to change.

*COLLECT* is an `FT.AGGREGATE` reducer that gathers per-document projections within a `GROUPBY` group and returns them
as an array of per-entry maps under the reducer alias, optionally sorted and bounded.

The server does not expose it by default: it must be enabled explicitly, for example via

```
CONFIG SET search-enable-unstable-features yes
```

In a cluster the coordinator fans the query out to every shard, so the flag must be enabled on all nodes rather than
only the one a given connection happens to route to. Without it, the server replies with an error.

The corresponding library feature must also be considered subject to change:

1. Existing bindings may cease working correctly if the underlying server API changes.
2. Changes to the server API may require changes to the library API, manifesting in either/both of build-time
or run-time breaks.

Because the server itself still classes this as an unstable feature, such changes are rather more likely here than for
a feature that has simply not been out for long. If you acknowledge this, you can suppress this warning by adding the
following to your `csproj` file:

```xml
<NoWarn>$(NoWarn);NRS003</NoWarn>
```

or more granularly / locally in C#:

```c#
#pragma warning disable NRS003
```
2 changes: 2 additions & 0 deletions src/NRedisStack/Experiments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ namespace NRedisStack
// NRS002 - Redis 8.8 multi-aggregate time-series
internal static class Experiments
{
public const string SearchCollect = "NRS003";

// {0} is substituted with the diagnostic id, e.g. NRS042 -> https://redis.github.io/NRedisStack/exp/NRS042
public const string UrlFormat = "https://redis.github.io/NRedisStack/exp/{0}";
}
Expand Down
20 changes: 10 additions & 10 deletions src/NRedisStack/PublicAPI/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1670,13 +1670,13 @@ NRedisStack.ISearchCommandsAsync.AliasListAsync(string! index) -> System.Threadi
NRedisStack.SearchCommands.AliasList(string! index) -> StackExchange.Redis.RedisResult![]!
NRedisStack.SearchCommandsAsync.AliasListAsync(string! index) -> System.Threading.Tasks.Task<StackExchange.Redis.RedisResult![]!>!
static NRedisStack.SearchCommandBuilder.AliasList(string! index) -> NRedisStack.RedisStackCommands.SerializedCommand!
NRedisStack.Search.Aggregation.CollectReducer
override NRedisStack.Search.Aggregation.CollectReducer.Name.get -> string!
NRedisStack.Search.Aggregation.CollectReducer.Fields(params string![]! fields) -> NRedisStack.Search.Aggregation.CollectReducer!
NRedisStack.Search.Aggregation.CollectReducer.FieldsAll() -> NRedisStack.Search.Aggregation.CollectReducer!
NRedisStack.Search.Aggregation.CollectReducer.SortBy(params NRedisStack.Search.Aggregation.SortedField![]! fields) -> NRedisStack.Search.Aggregation.CollectReducer!
NRedisStack.Search.Aggregation.CollectReducer.SortByAsc(string! field) -> NRedisStack.Search.Aggregation.CollectReducer!
NRedisStack.Search.Aggregation.CollectReducer.SortByDesc(string! field) -> NRedisStack.Search.Aggregation.CollectReducer!
NRedisStack.Search.Aggregation.CollectReducer.Limit(int count) -> NRedisStack.Search.Aggregation.CollectReducer!
NRedisStack.Search.Aggregation.CollectReducer.Limit(int offset, int count) -> NRedisStack.Search.Aggregation.CollectReducer!
static NRedisStack.Search.Aggregation.Reducers.Collect() -> NRedisStack.Search.Aggregation.CollectReducer!
[NRS003]NRedisStack.Search.Aggregation.CollectReducer
[NRS003]override NRedisStack.Search.Aggregation.CollectReducer.Name.get -> string!
[NRS003]NRedisStack.Search.Aggregation.CollectReducer.Fields(params string![]! fields) -> NRedisStack.Search.Aggregation.CollectReducer!
[NRS003]NRedisStack.Search.Aggregation.CollectReducer.FieldsAll() -> NRedisStack.Search.Aggregation.CollectReducer!
[NRS003]NRedisStack.Search.Aggregation.CollectReducer.SortBy(params NRedisStack.Search.Aggregation.SortedField![]! fields) -> NRedisStack.Search.Aggregation.CollectReducer!
[NRS003]NRedisStack.Search.Aggregation.CollectReducer.SortByAsc(string! field) -> NRedisStack.Search.Aggregation.CollectReducer!
[NRS003]NRedisStack.Search.Aggregation.CollectReducer.SortByDesc(string! field) -> NRedisStack.Search.Aggregation.CollectReducer!
[NRS003]NRedisStack.Search.Aggregation.CollectReducer.Limit(int count) -> NRedisStack.Search.Aggregation.CollectReducer!
[NRS003]NRedisStack.Search.Aggregation.CollectReducer.Limit(int offset, int count) -> NRedisStack.Search.Aggregation.CollectReducer!
[NRS003]static NRedisStack.Search.Aggregation.Reducers.Collect() -> NRedisStack.Search.Aggregation.CollectReducer!
4 changes: 3 additions & 1 deletion src/NRedisStack/Search/CollectReducer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NRedisStack.Search.Literals;
using System.Diagnostics.CodeAnalysis;
using NRedisStack.Search.Literals;

namespace NRedisStack.Search.Aggregation;

Expand Down Expand Up @@ -33,6 +34,7 @@ namespace NRedisStack.Search.Aggregation;
/// </para>
/// </summary>
/// <seealso cref="Reducers.Collect()"/>
[Experimental(Experiments.SearchCollect, UrlFormat = Experiments.UrlFormat)]
public sealed class CollectReducer : Reducer
{
private bool _allFields = false;
Expand Down
5 changes: 4 additions & 1 deletion src/NRedisStack/Search/Reducers.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace NRedisStack.Search.Aggregation;
using System.Diagnostics.CodeAnalysis;

namespace NRedisStack.Search.Aggregation;

public static class Reducers
{
Expand Down Expand Up @@ -92,6 +94,7 @@ protected override void AddOwnArgs(List<object> args)
/// </para>
/// </summary>
/// <seealso cref="CollectReducer"/>
[Experimental(Experiments.SearchCollect, UrlFormat = Experiments.UrlFormat)]
public static CollectReducer Collect() => new CollectReducer();

public static Reducer RandomSample(string field, int size) => new RandomSampleReducer(field, size);
Expand Down
Loading