diff --git a/src/NRedisStack/CountMinSketch/DataTypes/CmsInformation.cs b/src/NRedisStack/CountMinSketch/DataTypes/CmsInformation.cs index 9f5ac260..125d7439 100644 --- a/src/NRedisStack/CountMinSketch/DataTypes/CmsInformation.cs +++ b/src/NRedisStack/CountMinSketch/DataTypes/CmsInformation.cs @@ -10,11 +10,16 @@ public class CmsInformation public long Depth { get; private set; } public long Count { get; private set; } + /// + /// The counter byte width, in bytes. Not reported by older servers, in which case this is -1. + /// + public int CellSize { get; private set; } - internal CmsInformation(long width, long depth, long count) + internal CmsInformation(long width, long depth, long count, int cellSize) { Width = width; Depth = depth; Count = count; + CellSize = cellSize; } } \ No newline at end of file diff --git a/src/NRedisStack/PublicAPI/PublicAPI.Unshipped.txt b/src/NRedisStack/PublicAPI/PublicAPI.Unshipped.txt index 7dc5c581..666bcf99 100644 --- a/src/NRedisStack/PublicAPI/PublicAPI.Unshipped.txt +++ b/src/NRedisStack/PublicAPI/PublicAPI.Unshipped.txt @@ -1 +1,2 @@ #nullable enable +NRedisStack.CountMinSketch.DataTypes.CmsInformation.CellSize.get -> int diff --git a/src/NRedisStack/ResponseParser.cs b/src/NRedisStack/ResponseParser.cs index b212a9cf..1fd1024a 100644 --- a/src/NRedisStack/ResponseParser.cs +++ b/src/NRedisStack/ResponseParser.cs @@ -494,8 +494,10 @@ public static CmsInformation ToCmsInfo(this RedisResult result) //TODO: Think about a different implementation, because if the output of CMS.INFO changes or even just the names of the labels then the parsing will not work { long width, depth, count; + int cellSize; width = depth = count = -1; + cellSize = -1; RedisResult[] redisResults = result.ToArray(); @@ -514,10 +516,13 @@ public static CmsInformation case "count": count = (long)redisResults[i]; break; + case "cell size": + cellSize = (int)redisResults[i]; + break; } } - return new(width, depth, count); + return new(width, depth, count, cellSize); } public static TopKInformation diff --git a/tests/NRedisStack.Tests/Search/SearchTests.cs b/tests/NRedisStack.Tests/Search/SearchTests.cs index 5ac9b846..ffa37aa9 100644 --- a/tests/NRedisStack.Tests/Search/SearchTests.cs +++ b/tests/NRedisStack.Tests/Search/SearchTests.cs @@ -4168,7 +4168,7 @@ public async Task TestDocumentLoadWithDB_Issue352(string endpointId) // Number of documents indexed by the on-timeout tests. Large enough that scanning, scoring and // sorting them cannot complete within the 1ms per-query timeout, so the query engine's // on-timeout policy is guaranteed to kick in. - private const int TimeoutDocCount = 10_000; + private const int TimeoutDocCount = 100_000; private void PopulateTimeoutIndex(IDatabase db, SearchCommands ft) {