File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ async def get_index_info(index_name: str) -> str:
36
36
"""
37
37
try :
38
38
r = RedisConnectionManager .get_connection ()
39
- return r .ft (index_name ).info ()
39
+ info = r .ft (index_name ).info ()
40
+ return json .dumps (info , ensure_ascii = False , indent = 2 )
40
41
except RedisError as e :
41
42
return f"Error retrieving index info: { str (e )} "
42
43
@@ -49,11 +50,12 @@ async def get_indexed_keys_number(index_name: str) -> str:
49
50
index_name (str): The name of the index to retrieve information about.
50
51
51
52
Returns:
52
- int : Number of indexed keys
53
+ str : Number of indexed keys as a string
53
54
"""
54
55
try :
55
56
r = RedisConnectionManager .get_connection ()
56
- return r .ft (index_name ).search (Query ("*" )).total
57
+ total = r .ft (index_name ).search (Query ("*" )).total
58
+ return str (total )
57
59
except RedisError as e :
58
60
return f"Error retrieving number of keys: { str (e )} "
59
61
You can’t perform that action at this time.
0 commit comments