Skip to content
Draft
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
4 changes: 0 additions & 4 deletions tests/NRedisStack.Tests/CommunityEditionUpdatesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,10 @@ public void ConfigSearchSettings(string endpointId)

Assert.Single(server.ConfigGet("search-max-prefix-expansions"));

Assert.Single(server.ConfigGet("search-max-doctablesize"));

Assert.Single(server.ConfigGet("search-max-search-results"));

Assert.Single(server.ConfigGet("search-max-aggregate-results"));

Assert.Single(server.ConfigGet("search-friso-ini"));

Assert.Single(server.ConfigGet("search-default-dialect"));
}

Expand Down
152 changes: 78 additions & 74 deletions tests/NRedisStack.Tests/Search/SearchTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,34 @@
Assert.Equal(expected, await DatabaseSizeAsync(db));
}

private void AssertIndexSize(ISearchCommands ft, string index, int expected)
{
long indexed = -1;
// allow search time to catch up
for (int i = 0; i < 10; i++)
{
indexed = ft.Info(index).NumDocs;

if (indexed == expected)
break;
}
Assert.Equal(expected, indexed);
}

private async Task AssertIndexSizeAsync(ISearchCommandsAsync ft, string index, int expected)
{
long indexed = -1;
// allow search time to catch up
for (int i = 0; i < 10; i++)
{
indexed = (await ft.InfoAsync(index)).NumDocs;

if (indexed == expected)
break;
}
Assert.Equal(expected, indexed);
}

[SkipIfRedisTheory(Is.Enterprise)]
[MemberData(nameof(EndpointsFixture.Env.AllEnvironments), MemberType = typeof(EndpointsFixture.Env))]
public void TestAggregationRequestVerbatim(string endpointId)
Expand Down Expand Up @@ -249,7 +277,7 @@
ft.Create("idx", new(), sc);

AddDocument(db, new Document("doc1").Set("t1", "hello").Set("t2", "world"));
AssertDatabaseSize(db, 1);
AssertIndexSize(ft, "idx", 1);

Check failure on line 280 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.TestAggregationsLoad(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 1 Actual: 2

Check failure on line 280 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.TestAggregationsLoad(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 1 Actual: 2

Check failure on line 280 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.TestAggregationsLoad(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 1 Actual: 2

Check failure on line 280 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.TestAggregationsLoad(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 1 Actual: 2

// load t1
var req = new AggregationRequest("*").Load(new FieldName("t1"));
Expand Down Expand Up @@ -283,7 +311,7 @@
await ft.CreateAsync("idx", new(), sc);

AddDocument(db, new Document("doc1").Set("t1", "hello").Set("t2", "world"));
await AssertDatabaseSizeAsync(db, 1);
await AssertIndexSizeAsync(ft, "idx", 1);

// load t1
var req = new AggregationRequest("*").Load(new FieldName("t1"));
Expand Down Expand Up @@ -533,52 +561,37 @@
sc.AddNumericField("subj1", sortable: true);
sc.AddNumericField("subj2", sortable: true);
ft.Create(index, FTCreateParams.CreateParams(), sc);
// client.AddDocument(db, new Document("data1").Set("name", "abc").Set("subj1", 20).Set("subj2", 70));
// client.AddDocument(db, new Document("data2").Set("name", "def").Set("subj1", 60).Set("subj2", 40));
// client.AddDocument(db, new Document("data3").Set("name", "ghi").Set("subj1", 50).Set("subj2", 80));
// client.AddDocument(db, new Document("data4").Set("name", "abc").Set("subj1", 30).Set("subj2", 20));
// client.AddDocument(db, new Document("data5").Set("name", "def").Set("subj1", 65).Set("subj2", 45));
// client.AddDocument(db, new Document("data6").Set("name", "ghi").Set("subj1", 70).Set("subj2", 70));
AddDocument(db, new Document("data1").Set("name", "abc").Set("subj1", 20).Set("subj2", 70));
AddDocument(db, new Document("data2").Set("name", "def").Set("subj1", 60).Set("subj2", 40));
AddDocument(db, new Document("data3").Set("name", "ghi").Set("subj1", 50).Set("subj2", 80));
AddDocument(db, new Document("data4").Set("name", "abc").Set("subj1", 30).Set("subj2", 20));
AddDocument(db, new Document("data5").Set("name", "def").Set("subj1", 65).Set("subj2", 45));
AddDocument(db, new Document("data6").Set("name", "ghi").Set("subj1", 70).Set("subj2", 70));
AssertDatabaseSize(db, 6);
AssertIndexSize(ft, index, 6);

int maxAttempts = endpointId == EndpointsFixture.Env.Cluster ? 10 : 3;
for (int attempt = 1; attempt <= maxAttempts; attempt++)
{
AggregationRequest r = new AggregationRequest().Apply("(@subj1+@subj2)/2", "attemptavg")
.GroupBy("@name", Reducers.Avg("@attemptavg").As("avgscore"))
.Filter("@avgscore>=50")
.SortBy(10, SortedField.Asc("@name"));
AggregationRequest r = new AggregationRequest().Apply("(@subj1+@subj2)/2", "attemptavg")
.GroupBy("@name", Reducers.Avg("@attemptavg").As("avgscore"))
.Filter("@avgscore>=50")
.SortBy(10, SortedField.Asc("@name"));

// abc: 20+70 => 45, 30+20 => 25, filtered out
// def: 60+40 => 50, 65+45 => 55, avg 52.5
// ghi: 50+80 => 65, 70+70 => 70, avg 67.5
// abc: 20+70 => 45, 30+20 => 25, filtered out
// def: 60+40 => 50, 65+45 => 55, avg 52.5
// ghi: 50+80 => 65, 70+70 => 70, avg 67.5

// actual search
AggregationResult res = ft.Aggregate(index, r);
Assert.Equal(2, res.TotalResults);
// actual search
AggregationResult res = ft.Aggregate(index, r);
Assert.Equal(2, res.TotalResults);

Row r1 = res.GetRow(0);
Row r2 = res.GetRow(1);
Log($"Attempt {attempt} of {maxAttempts}: avgscore {r2.GetDouble("avgscore")}");
if (attempt != maxAttempts && !IsNear(r2.GetDouble("avgscore"), 67.5))
{
Thread.Sleep(400); // allow extra cluster replication time
continue;
}
Row r1 = res.GetRow(0);
Row r2 = res.GetRow(1);

Assert.Equal("def", r1.GetString("name"));
Assert.Equal(52.5, r1.GetDouble("avgscore"), 0);
Assert.True(IsNear(r2.GetDouble("avgscore"), 67.5));

Assert.Equal("ghi", r2.GetString("name"));
Assert.Equal(67.5, r2.GetDouble("avgscore"), 0);
break; // success!
}
Assert.Equal("def", r1.GetString("name"));
Assert.Equal(52.5, r1.GetDouble("avgscore"), 0);

Assert.Equal("ghi", r2.GetString("name"));
Assert.Equal(67.5, r2.GetDouble("avgscore"), 0);
}

private static bool IsNear(double a, double b, double epsilon = 0.1) => Math.Abs(a - b) < epsilon;
Expand All @@ -602,7 +615,7 @@
db.HashSet("pupil:4444", [new("first", "Pat"), new("last", "Shu"), new("age", "21")]);
db.HashSet("student:5555", [new("first", "Joen"), new("last", "Ko"), new("age", "20")]);
db.HashSet("teacher:6666", [new("first", "Pat"), new("last", "Rod"), new("age", "20")]);
AssertDatabaseSize(db, 7);
AssertIndexSize(ft, index, 4); // only pupil and student keys are indexed

var noFilters = ft.Search(index, new());
Assert.Equal(4, noFilters.TotalResults);
Expand Down Expand Up @@ -634,7 +647,7 @@
db.HashSet("pupil:4444", [new("first", "Pat"), new("last", "Shu"), new("age", "21")]);
db.HashSet("student:5555", [new("first", "Joen"), new("last", "Ko"), new("age", "20")]);
db.HashSet("teacher:6666", [new("first", "Pat"), new("last", "Rod"), new("age", "20")]);
await AssertDatabaseSizeAsync(db, 7);
await AssertIndexSizeAsync(ft, index, 4); // only pupil and student keys are indexed

var noFilters = ft.Search(index, new());
Assert.Equal(4, noFilters.TotalResults);
Expand All @@ -661,7 +674,7 @@
db.HashSet("student:3333", [new("first", "El"), new("last", "Mark"), new("age", 17)]);
db.HashSet("pupil:4444", [new("first", "Pat"), new("last", "Shu"), new("age", 21)]);
db.HashSet("student:5555", [new("first", "Joen"), new("last", "Ko"), new("age", 20)]);
AssertDatabaseSize(db, 4);
AssertIndexSize(ft, index, 4);

Check failure on line 677 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.CreateNoParams(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 4 Actual: 8

Check failure on line 677 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.CreateNoParams(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 4 Actual: 8

Check failure on line 677 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.CreateNoParams(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 4 Actual: 8

Check failure on line 677 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.CreateNoParams(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 4 Actual: 8

SearchResult noFilters = ft.Search(index, new());
Assert.Equal(4, noFilters.TotalResults);
Expand Down Expand Up @@ -691,7 +704,7 @@
db.HashSet("student:3333", [new("first", "El"), new("last", "Mark"), new("age", 17)]);
db.HashSet("pupil:4444", [new("first", "Pat"), new("last", "Shu"), new("age", 21)]);
db.HashSet("student:5555", [new("first", "Joen"), new("last", "Ko"), new("age", 20)]);
await AssertDatabaseSizeAsync(db, 4);
await AssertIndexSizeAsync(ft, index, 4);

SearchResult noFilters = ft.Search(index, new());
Assert.Equal(4, noFilters.TotalResults);
Expand Down Expand Up @@ -725,7 +738,8 @@
db.HashSet("pupil:4444", [new("first", "Pat"), new("last", "Shu"), new("age", "21")]);
db.HashSet("student:5555", [new("first", "Joen"), new("last", "Ko"), new("age", "20")]);
db.HashSet("teacher:6666", [new("first", "Pat"), new("last", "Rod"), new("age", "20")]);
AssertDatabaseSize(db, 7);

AssertIndexSize(ft, index, 5); // only pupil and student keys are indexed

Check failure on line 742 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.CreateWithFieldNames(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 5 Actual: 10

Check failure on line 742 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.CreateWithFieldNames(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 5 Actual: 10

Check failure on line 742 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.CreateWithFieldNames(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 5 Actual: 10

Check failure on line 742 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.CreateWithFieldNames(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 5 Actual: 10

SearchResult noFilters = ft.Search(index, new());
Assert.Equal(5, noFilters.TotalResults);
Expand Down Expand Up @@ -1288,7 +1302,7 @@
AddDocument(db, new Document("data1").Set("name", "abc").Set("count", 10));
AddDocument(db, new Document("data2").Set("name", "def").Set("count", 5));
AddDocument(db, new Document("data3").Set("name", "def").Set("count", 25));
AssertDatabaseSize(db, 3);
AssertIndexSize(ft, index, 3);

Check failure on line 1305 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.TestCursor(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6

Check failure on line 1305 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.TestCursor(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6

Check failure on line 1305 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.TestCursor(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6

Check failure on line 1305 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.TestCursor(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6

AggregationRequest r = new AggregationRequest()
.GroupBy("@name", Reducers.Sum("@count").As("sum"))
Expand Down Expand Up @@ -1344,7 +1358,7 @@
AddDocument(db, new Document("data1").Set("name", "abc").Set("count", 10));
AddDocument(db, new Document("data2").Set("name", "def").Set("count", 5));
AddDocument(db, new Document("data3").Set("name", "def").Set("count", 25));
AssertDatabaseSize(db, 3);
AssertIndexSize(ft, index, 3);

AggregationRequest r = new AggregationRequest()
.GroupBy("@name", Reducers.Sum("@count").As("sum"))
Expand Down Expand Up @@ -1383,7 +1397,7 @@
AddDocument(db, new Document("data1").Set("name", "abc").Set("count", 10));
AddDocument(db, new Document("data2").Set("name", "def").Set("count", 5));
AddDocument(db, new Document("data3").Set("name", "def").Set("count", 25));
await AssertDatabaseSizeAsync(db, 3);
await AssertIndexSizeAsync(ft, index, 3);

AggregationRequest r = new AggregationRequest()
.GroupBy("@name", Reducers.Sum("@count").As("sum"))
Expand Down Expand Up @@ -1439,7 +1453,7 @@
AddDocument(db, new Document("data1").Set("name", "abc").Set("count", 10));
AddDocument(db, new Document("data2").Set("name", "def").Set("count", 5));
AddDocument(db, new Document("data3").Set("name", "def").Set("count", 25));
await AssertDatabaseSizeAsync(db, 3);
await AssertIndexSizeAsync(ft, index, 3);

Check failure on line 1456 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.TestCursorEnumerableAsync(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6

Check failure on line 1456 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.TestCursorEnumerableAsync(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6

Check failure on line 1456 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.TestCursorEnumerableAsync(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6

Check failure on line 1456 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.TestCursorEnumerableAsync(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6

AggregationRequest r = new AggregationRequest()
.GroupBy("@name", Reducers.Sum("@count").As("sum"))
Expand Down Expand Up @@ -1637,17 +1651,11 @@

Assert.True(ft.DropIndex(index));

try
{
ft.Search(index, new("hello world"));
//fail("Index should not exist.");
}
catch (RedisServerException ex)
{
Assert.Contains("no such index", ex.Message, StringComparison.OrdinalIgnoreCase);
}
var ex = Record.Exception(() => { ft.Search(index, new("hello world")); });

AssertDatabaseSize(db, 100);
Assert.NotNull(ex);
Assert.IsType<RedisServerException>(ex);
Assert.Contains("no such index", ex.Message, StringComparison.OrdinalIgnoreCase);
}

private int DatabaseSize(IDatabase db) => DatabaseSize(db, out _);
Expand Down Expand Up @@ -1707,17 +1715,11 @@

Assert.True(await ft.DropIndexAsync(index));

try
{
ft.Search(index, new("hello world"));
//fail("Index should not exist.");
}
catch (RedisServerException ex)
{
Assert.Contains("no such index", ex.Message, StringComparison.OrdinalIgnoreCase);
}
var ex = Record.Exception(() => { ft.Search(index, new("hello world")); });

AssertDatabaseSize(db, 100);
Assert.NotNull(ex);
Assert.IsType<RedisServerException>(ex);
Assert.Contains("no such index", ex.Message, StringComparison.OrdinalIgnoreCase);
}

[SkippableTheory]
Expand All @@ -1736,6 +1738,7 @@
{
AddDocument(db, $"doc{i}", fields);
}
AssertIndexSize(ft, index, 100);

Check failure on line 1741 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.dropIndexDD(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 100 Actual: 200

Check failure on line 1741 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.dropIndexDD(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 100 Actual: 200

Check failure on line 1741 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.dropIndexDD(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 100 Actual: 200

Check failure on line 1741 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.dropIndexDD(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 100 Actual: 200

SearchResult res = ft.Search(index, new("hello world"));
Assert.Equal(100, res.TotalResults);
Expand Down Expand Up @@ -1763,6 +1766,7 @@
{
AddDocument(db, $"doc{i}", fields);
}
AssertIndexSize(ft, index, 100);

SearchResult res = ft.Search(index, new("hello world"));
Assert.Equal(100, res.TotalResults);
Expand Down Expand Up @@ -2523,7 +2527,7 @@
Document doc2 = new("doc2", new() { { "t1", "b" }, { "t2", "a" } });
AddDocument(db, doc1);
AddDocument(db, doc2);
AssertDatabaseSize(db, 2);
AssertIndexSize(ft, "idx", 2);

var req = new AggregationRequest("*").SortBy("@t1").Limit(1);
var res = ft.Aggregate("idx", req);
Expand All @@ -2545,7 +2549,7 @@
Document doc2 = new("doc2", new() { { "t1", "b" }, { "t2", "a" } });
AddDocument(db, doc1);
AddDocument(db, doc2);
await AssertDatabaseSizeAsync(db, 2);
await AssertIndexSizeAsync(ft, "idx", 2);

Check failure on line 2552 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.TestLimitAsync(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 2 Actual: 4

Check failure on line 2552 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.TestLimitAsync(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 2 Actual: 4

Check failure on line 2552 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.TestLimitAsync(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 2 Actual: 4

Check failure on line 2552 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.TestLimitAsync(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 2 Actual: 4

var req = new AggregationRequest("*").SortBy("@t1").Limit(1, 1);
var res = await ft.AggregateAsync("idx", req);
Expand Down Expand Up @@ -2633,7 +2637,7 @@
float[] vec = [2, 2, 2, 2];
byte[] queryVec = MemoryMarshal.Cast<float, byte>(vec).ToArray();

AssertDatabaseSize(db, 4);
AssertIndexSize(ft, "vss_idx", 4);
var query = new Query("*=>[KNN 3 @vector $query_vec]")
.AddParam("query_vec", queryVec)
.SetSortBy("__vector_score")
Expand Down Expand Up @@ -2672,7 +2676,7 @@
db.HashSet("b", "v", "aaaabaaa");
db.HashSet("c", "v", "aaaaabaa");

AssertDatabaseSize(db, 3);
AssertIndexSize(ft, "idx", 3);

Check failure on line 2679 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.QueryingVectorFields(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6

Check failure on line 2679 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.QueryingVectorFields(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6

Check failure on line 2679 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.QueryingVectorFields(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6

Check failure on line 2679 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.QueryingVectorFields(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6
var q = new Query("*=>[KNN 2 @v $vec]").ReturnFields("__v_score").Dialect(2);
var res = ft.Search("idx", q.AddParam("vec", "aaaaaaaa"));
Assert.Equal(2, res.TotalResults);
Expand Down Expand Up @@ -2714,7 +2718,7 @@
db.HashSet("2", "numval", 2);
db.HashSet("3", "numval", 3);

AssertDatabaseSize(db, 3);
AssertIndexSize(ft, "idx", 3);
Query query = new Query("@numval:[$min $max]").AddParam("min", 1).AddParam("max", 2);
var res = ft.Search("idx", query);
Assert.Equal(2, res.TotalResults);
Expand All @@ -2735,7 +2739,7 @@
db.HashSet("2", "numval", 2);
db.HashSet("3", "numval", 3);

await AssertDatabaseSizeAsync(db, 3);
await AssertIndexSizeAsync(ft, "idx", 3);
Query query = new Query("@numval:[$min $max]").AddParam("min", 1).AddParam("max", 2);
var res = await ft.SearchAsync("idx", query);
Assert.Equal(2, res.TotalResults);
Expand All @@ -2756,7 +2760,7 @@
db.HashSet("2", "numval", 2);
db.HashSet("3", "numval", 3);

AssertDatabaseSize(db, 3);
AssertIndexSize(ft, "idx", 3);

Check failure on line 2763 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.TestQueryParamsWithParams_DefaultDialect(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6

Check failure on line 2763 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.TestQueryParamsWithParams_DefaultDialect(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6

Check failure on line 2763 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.TestQueryParamsWithParams_DefaultDialect(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6

Check failure on line 2763 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.TestQueryParamsWithParams_DefaultDialect(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6
Query query = new Query("@numval:[$min $max]").AddParam("min", 1).AddParam("max", 2);
var res = ft.Search("idx", query);
Assert.Equal(2, res.TotalResults);
Expand Down Expand Up @@ -2807,7 +2811,7 @@
db.HashSet("doc1", [new("name", "name2"), new("body", "body2")]);
db.HashSet("doc1", [new("name", "name2"), new("body", "name2")]);

await AssertDatabaseSizeAsync(db, 1);
await AssertIndexSizeAsync(ft, index, 1);
var reply = await ft.SpellCheckAsync(index, "name");
Assert.Single(reply.Keys);
Assert.Equal("name", reply.Keys.First());
Expand Down Expand Up @@ -2929,7 +2933,7 @@
db.HashSet("2", "numval", 2);
db.HashSet("3", "numval", 3);

AssertDatabaseSize(db, 3);
AssertIndexSize(ft, "idx", 3);

Check failure on line 2936 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.TestQueryParamsWithParams_DefaultDialectAsync(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6

Check failure on line 2936 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.2.1; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.TestQueryParamsWithParams_DefaultDialectAsync(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6

Check failure on line 2936 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 9.0;

NRedisStack.Tests.Search.SearchTests.TestQueryParamsWithParams_DefaultDialectAsync(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6

Check failure on line 2936 in tests/NRedisStack.Tests/Search/SearchTests.cs

View workflow job for this annotation

GitHub Actions / Redis 8.0.2; .NET 8.0;

NRedisStack.Tests.Search.SearchTests.TestQueryParamsWithParams_DefaultDialectAsync(endpointId: "cluster")

Assert.Equal() Failure: Values differ Expected: 3 Actual: 6
Query query = new Query("@numval:[$min $max]").AddParam("min", 1).AddParam("max", 2);
var res = await ft.SearchAsync("idx", query);
Assert.Equal(2, res.TotalResults);
Expand Down
Loading