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
7 changes: 6 additions & 1 deletion src/NRedisStack/CountMinSketch/DataTypes/CmsInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ public class CmsInformation
public long Depth { get; private set; }
public long Count { get; private set; }

/// <summary>
/// The counter byte width, in bytes. Not reported by older servers, in which case this is -1.
/// </summary>
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;
}
}
1 change: 1 addition & 0 deletions src/NRedisStack/PublicAPI/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#nullable enable
NRedisStack.CountMinSketch.DataTypes.CmsInformation.CellSize.get -> int
7 changes: 6 additions & 1 deletion src/NRedisStack/ResponseParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/NRedisStack.Tests/Search/SearchTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Comment thread
mgravell marked this conversation as resolved.
Comment thread
mgravell marked this conversation as resolved.

private void PopulateTimeoutIndex(IDatabase db, SearchCommands ft)
{
Expand Down
Loading