@@ -30,8 +30,8 @@ def __init__(self, url: str = "http://localhost:7700", api_key: Optional[str] =
3030 async def health_check (self ) -> bool :
3131 """Check if Meilisearch is healthy"""
3232 try :
33- health = self .client .health ()
34- return health . status == "available"
33+ response = self .client .health ()
34+ return response . get ( " status" ) == "available"
3535 except Exception :
3636 return False
3737
@@ -41,4 +41,25 @@ async def get_version(self) -> Dict[str, Any]:
4141
4242 async def get_stats (self ) -> Dict [str , Any ]:
4343 """Get database stats"""
44- return self .client .get_stats ()
44+ # return self.client.get_stats()
45+ return "This method has not yet been implemented in the Meilisearch client."
46+
47+ async def get_indexes (self ) -> Dict [str , Any ]:
48+ """Get all indexes"""
49+ indexes = self .client .get_indexes ()
50+ # Convert Index objects to serializable dictionaries
51+ serialized_indexes = []
52+ for index in indexes ['results' ]:
53+ serialized_indexes .append ({
54+ "uid" : index .uid ,
55+ "primaryKey" : index .primary_key ,
56+ "createdAt" : index .created_at ,
57+ "updatedAt" : index .updated_at
58+ })
59+
60+ return {
61+ "results" : serialized_indexes ,
62+ "offset" : indexes ['offset' ],
63+ "limit" : indexes ['limit' ],
64+ "total" : indexes ['total' ]
65+ }
0 commit comments