Skip to content

Commit 3800073

Browse files
committed
actually: not a key
1 parent ec6f1ea commit 3800073

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/NRedisStack/Search/SearchCommandBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public static SerializedCommand DictAdd(string dict, params string[] terms)
9191
throw new ArgumentOutOfRangeException("At least one term must be provided");
9292
}
9393

94-
var args = new List<object>(terms.Length + 1) { (RedisKey)dict };
94+
var args = new List<object>(terms.Length + 1) { dict };
9595
foreach (var t in terms)
9696
{
9797
args.Add(t);
@@ -107,7 +107,7 @@ public static SerializedCommand DictDel(string dict, params string[] terms)
107107
throw new ArgumentOutOfRangeException("At least one term must be provided");
108108
}
109109

110-
var args = new List<object>(terms.Length + 1) { (RedisKey)dict };
110+
var args = new List<object>(terms.Length + 1) { dict };
111111
foreach (var t in terms)
112112
{
113113
args.Add(t);
@@ -118,7 +118,7 @@ public static SerializedCommand DictDel(string dict, params string[] terms)
118118

119119
public static SerializedCommand DictDump(string dict)
120120
{
121-
return new(FT.DICTDUMP, (RedisKey)dict);
121+
return new(FT.DICTDUMP, dict);
122122
}
123123

124124
public static SerializedCommand DropIndex(string indexName, bool dd = false)

tests/NRedisStack.Tests/Search/SearchTests.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,14 +1498,15 @@ public void TestDictionary(string endpointId)
14981498
var ft = db.FT();
14991499

15001500
Assert.Equal(3L, ft.DictAdd("dict", "bar", "foo", "hello world"));
1501-
1501+
Assert.Equal(0, DatabaseSize(db)); // in part, this is to allow replication to catch up
15021502
var dumResult = ft.DictDump("dict");
15031503
int i = 0;
15041504
Assert.Equal("bar", dumResult[i++].ToString());
15051505
Assert.Equal("foo", dumResult[i++].ToString());
15061506
Assert.Equal("hello world", dumResult[i].ToString());
15071507

15081508
Assert.Equal(3L, ft.DictDel("dict", "foo", "bar", "hello world"));
1509+
Assert.Equal(0, DatabaseSize(db)); // in part, this is to allow replication to catch up
15091510
Assert.Empty(ft.DictDump("dict"));
15101511
}
15111512

@@ -1672,14 +1673,15 @@ public async Task TestDictionaryAsync(string endpointId)
16721673
var ft = db.FT();
16731674

16741675
Assert.Equal(3L, await ft.DictAddAsync("dict", "bar", "foo", "hello world"));
1675-
1676+
Assert.Equal(0, await DatabaseSizeAsync(db)); // in part, this is to allow replication to catch up
16761677
var dumResult = await ft.DictDumpAsync("dict");
16771678
int i = 0;
16781679
Assert.Equal("bar", dumResult[i++].ToString());
16791680
Assert.Equal("foo", dumResult[i++].ToString());
16801681
Assert.Equal("hello world", dumResult[i].ToString());
16811682

16821683
Assert.Equal(3L, await ft.DictDelAsync("dict", "foo", "bar", "hello world"));
1684+
Assert.Equal(0, await DatabaseSizeAsync(db)); // in part, this is to allow replication to catch up
16831685
Assert.Empty((await ft.DictDumpAsync("dict")));
16841686
}
16851687

@@ -2704,6 +2706,7 @@ public async Task TestCrossTermDictionaryAsync(string endpointId)
27042706
}
27052707
};
27062708

2709+
Assert.Equal(0, DatabaseSize(db)); // in part, this is to allow replication to catch up
27072710
Assert.Equal(expected, await ft.SpellCheckAsync(index,
27082711
"Tooni toque kerfuffle",
27092712
new FTSpellCheckParams()

0 commit comments

Comments
 (0)