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:
3636 """
3737 try :
3838 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 )
4041 except RedisError as e :
4142 return f"Error retrieving index info: { str (e )} "
4243
@@ -49,11 +50,12 @@ async def get_indexed_keys_number(index_name: str) -> str:
4950 index_name (str): The name of the index to retrieve information about.
5051
5152 Returns:
52- int : Number of indexed keys
53+ str : Number of indexed keys as a string
5354 """
5455 try :
5556 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 )
5759 except RedisError as e :
5860 return f"Error retrieving number of keys: { str (e )} "
5961
You can’t perform that action at this time.
0 commit comments