File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ def __init__(
38
38
score = float (res [i + 1 ]) if with_scores else None
39
39
40
40
fields = {}
41
- if hascontent :
41
+ if hascontent and res [ i + fields_offset ] is not None :
42
42
fields = (
43
43
dict (
44
44
dict (
Original file line number Diff line number Diff line change @@ -1698,3 +1698,17 @@ def test_dialect(modclient: redis.Redis):
1698
1698
with pytest .raises (redis .ResponseError ) as err :
1699
1699
modclient .ft ().explain (Query ("@title:(@num:[0 10])" ).dialect (2 ))
1700
1700
assert "Syntax error" in str (err )
1701
+
1702
+
1703
+ @pytest .mark .redismod
1704
+ def test_expire_while_search (modclient : redis .Redis ):
1705
+ modclient .ft ().create_index ((TextField ("txt" ),))
1706
+ modclient .hset ("hset:1" , "txt" , "a" )
1707
+ modclient .hset ("hset:2" , "txt" , "b" )
1708
+ modclient .hset ("hset:3" , "txt" , "c" )
1709
+ assert 3 == modclient .ft ().search (Query ("*" )).total
1710
+ modclient .pexpire ("hset:2" , 300 )
1711
+ for _ in range (500 ):
1712
+ modclient .ft ().search (Query ("*" )).docs [1 ]
1713
+ time .sleep (1 )
1714
+ assert 2 == modclient .ft ().search (Query ("*" )).total
You can’t perform that action at this time.
0 commit comments