summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAriel Shtul <ariel.shtul@redislabs.com>2021-11-14 14:06:58 +0200
committerGitHub <noreply@github.com>2021-11-14 14:06:58 +0200
commitc8cb7150abe99b77f9f6bde1fba8ecb527295110 (patch)
treeac48afe56bd02f433f4723d5e44b93d427581dfb
parent19819e08211cc12f85c45294ad6209b2d5626337 (diff)
downloadredis-py-c8cb7150abe99b77f9f6bde1fba8ecb527295110.tar.gz
Call HSET after FT.CREATE to avoid keyspace scan (#1706)
-rw-r--r--tests/test_search.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_search.py b/tests/test_search.py
index e07a61c..75559d3 100644
--- a/tests/test_search.py
+++ b/tests/test_search.py
@@ -643,9 +643,6 @@ def test_alias():
index1 = getClient()
index2 = getClient()
- index1.hset("index1:lonestar", mapping={"name": "lonestar"})
- index2.hset("index2:yogurt", mapping={"name": "yogurt"})
-
def1 = IndexDefinition(prefix=["index1:"])
def2 = IndexDefinition(prefix=["index2:"])
@@ -654,6 +651,9 @@ def test_alias():
ftindex1.create_index((TextField("name"),), definition=def1)
ftindex2.create_index((TextField("name"),), definition=def2)
+ index1.hset("index1:lonestar", mapping={"name": "lonestar"})
+ index2.hset("index2:yogurt", mapping={"name": "yogurt"})
+
res = ftindex1.search("*").docs[0]
assert "index1:lonestar" == res.id