A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/StackExchange/StackExchange.Redis/issues/1791 below:

NRediSearch.AggregationResult not contains result of TOLIST reducer. · Issue #11 · StackExchange/NRediSearch · GitHub

Hello, I ran into the fact that the result of the work of the TOLIST reducer is not present in AggregationResult.
In the process of debugging, I discovered that this case is not covered.

`

public sealed class AggregationResult
{
    private readonly Dictionary<string, RedisValue>[] _results;

    internal AggregationResult(RedisResult result, long cursorId = -1)
    {
        var arr = (RedisResult[])result;

        _results = new Dictionary<string, RedisValue>[arr.Length - 1];
        for (int i = 1; i < arr.Length; i++)
        {
            var raw = (RedisResult[])arr[i];
            var cur = new Dictionary<string, RedisValue>();
            for (int j = 0; j < raw.Length;)
            {
                var key = (string)raw[j++];
                var val = raw[j++];
                if (val.Type != ResultType.MultiBulk)//for TOLIST reducer type is multibulk and it will be skipped
                    cur.Add(key, (RedisValue)val);
            }
            _results[i - 1] = cur;
        }

        CursorId = cursorId;
    }
    public IReadOnlyList<Dictionary<string, RedisValue>> GetResults() => _results;

    public Dictionary<string, RedisValue> this[int index]
        => index >= _results.Length ? null : _results[index];

    public Row? GetRow(int index)
    {
        if (index >= _results.Length) return null;
        return new Row(_results[index]);
    }

    public long CursorId { get; }
}

`


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4