@@ -48,7 +48,7 @@ kwargs.
4848
4949* ** Parameters:**
5050 * ** schema** ([ * IndexSchema* ] ({{< relref "schema/#indexschema" >}})) – Index schema object.
51- * ** redis_client** (* Optional* * [ * * redis. Redis* * ] * ) – An
51+ * ** redis_client** (* Optional* * [ * * Redis* * ] * ) – An
5252 instantiated redis client.
5353 * ** redis_url** (* Optional* * [ * * str* * ] * ) – The URL of the Redis server to
5454 connect to.
@@ -88,13 +88,13 @@ This method takes a list of queries and optionally query params and
8888returns a list of Result objects for each query. Results are
8989returned in the same order as the queries.
9090
91+ NOTE: Cluster users may need to incorporate hash tags into their query
92+ to avoid cross-slot operations.
93+
9194* ** Parameters:**
92- * ** queries** (* List* * [ * * SearchParams* * ] * ) – The queries to search for. batch_size
93- * ** (* *** int** – The number of queries to search for at a time.
94- Defaults to 10.
95- * ** optional**** )** – The number of queries to search for at a time.
95+ * ** queries** (* List* * [ * * SearchParams* * ] * ) – The queries to search for.
96+ * ** batch_size** (* int* * ,* * optional* ) – The number of queries to search for at a time.
9697 Defaults to 10.
97- * ** batch_size** (* int* )
9898* ** Returns:**
9999 The search results for each query.
100100* ** Return type:**
@@ -105,6 +105,10 @@ returned in the same order as the queries.
105105Clear all keys in Redis associated with the index, leaving the index
106106available and in-place for future insertions or updates.
107107
108+ NOTE: This method requires custom behavior for Redis Cluster because
109+ here, we can’t easily give control of the keys we’re clearing to the
110+ user so they can separate them based on hash tag.
111+
108112* ** Returns:**
109113 Count of records deleted from Redis.
110114* ** Return type:**
@@ -176,6 +180,10 @@ Remove documents from the index by their document IDs.
176180This method converts document IDs to Redis keys automatically by applying
177181the index’s key prefix and separator configuration.
178182
183+ NOTE: Cluster users will need to incorporate hash tags into their
184+ document IDs and only call this method with documents from a single hash
185+ tag at a time.
186+
179187* ** Parameters:**
180188 ** ids** (* Union* * [ * * str* * ,* * List* * [ * * str* * ] * * ] * ) – The document ID or IDs to remove from the index.
181189* ** Returns:**
@@ -261,7 +269,7 @@ Initialize from an existing search index in Redis by index name.
261269
262270* ** Parameters:**
263271 * ** name** (* str* ) – Name of the search index in Redis.
264- * ** redis_client** (* Optional* * [ * * redis. Redis* * ] * ) – An
272+ * ** redis_client** (* Optional* * [ * * Redis* * ] * ) – An
265273 instantiated redis client.
266274 * ** redis_url** (* Optional* * [ * * str* * ] * ) – The URL of the Redis server to
267275 connect to.
@@ -436,12 +444,12 @@ Async Redis client. It is useful for cases where an external,
436444custom-configured client is preferred instead of creating a new one.
437445
438446* ** Parameters:**
439- ** redis_client** (* redis. Redis* ) – A Redis or Async Redis
447+ ** redis_client** (* Redis* ) – A Redis or Async Redis
440448 client instance to be used for the connection.
441449* ** Raises:**
442450 ** TypeError** – If the provided client is not valid.
443451
444- #### ` property client: Redis | None `
452+ #### ` property client: Redis | RedisCluster | None `
445453
446454The underlying redis-py client object.
447455
@@ -503,7 +511,7 @@ Initialize the RedisVL async search index with a schema.
503511 * ** schema** ([ * IndexSchema* ] ({{< relref "schema/#indexschema" >}})) – Index schema object.
504512 * ** redis_url** (* Optional* * [ * * str* * ] * * ,* * optional* ) – The URL of the Redis server to
505513 connect to.
506- * ** redis_client** (* Optional* * [ * * aredis.Redis * * ] * ) – An
514+ * ** redis_client** (* Optional* * [ * * AsyncRedis * * ] * ) – An
507515 instantiated redis client.
508516 * ** connection_kwargs** (* Optional* * [ * * Dict* * [ * * str* * ,* * Any* * ] * * ] * ) – Redis client connection
509517 args.
@@ -535,28 +543,42 @@ Asynchronously execute a batch of queries and process results.
535543
536544#### ` async batch_search(queries, batch_size=10) `
537545
538- Perform a search against the index for multiple queries.
546+ Asynchronously execute a batch of search queries.
547+
548+ This method takes a list of search queries and executes them in batches
549+ to improve performance when dealing with multiple queries.
539550
540- This method takes a list of queries and returns a list of Result objects
541- for each query. Results are returned in the same order as the queries .
551+ NOTE: Cluster users may need to incorporate hash tags into their query
552+ to avoid cross-slot operations .
542553
543554* ** Parameters:**
544- * ** queries** (* List* * [ * * SearchParams* * ] * ) – The queries to search for. batch_size
545- * ** (* *** int** – The number of queries to search for at a time.
546- Defaults to 10.
547- * ** optional**** )** – The number of queries to search for at a time.
548- Defaults to 10.
549- * ** batch_size** (* int* )
555+ * ** queries** (* List* * [ * * SearchParams* * ] * ) – A list of search queries to execute.
556+ Each query can be either a string or a tuple of (query, params).
557+ * ** batch_size** (* int* * ,* * optional* ) – The number of queries to execute in each
558+ batch. Defaults to 10.
550559* ** Returns:**
551- The search results for each query.
560+ A list of search results corresponding to each query.
552561* ** Return type:**
553562 List[ Result]
554563
564+ ``` python
565+ queries = [
566+ " hello world" ,
567+ (" goodbye world" , {" num_results" : 5 }),
568+ ]
569+
570+ results = await index.batch_search(queries)
571+ ```
572+
555573#### ` async clear() `
556574
557575Clear all keys in Redis associated with the index, leaving the index
558576available and in-place for future insertions or updates.
559577
578+ NOTE: This method requires custom behavior for Redis Cluster because here,
579+ we can’t easily give control of the keys we’re clearing to the user so they
580+ can separate them based on hash tag.
581+
560582* ** Returns:**
561583 Count of records deleted from Redis.
562584* ** Return type:**
@@ -617,6 +639,10 @@ Remove documents from the index by their document IDs.
617639This method converts document IDs to Redis keys automatically by applying
618640the index’s key prefix and separator configuration.
619641
642+ NOTE: Cluster users will need to incorporate hash tags into their
643+ document IDs and only call this method with documents from a single hash
644+ tag at a time.
645+
620646* ** Parameters:**
621647 ** ids** (* Union* * [ * * str* * ,* * List* * [ * * str* * ] * * ] * ) – The document ID or IDs to remove from the index.
622648* ** Returns:**
@@ -700,7 +726,7 @@ Initialize from an existing search index in Redis by index name.
700726
701727* ** Parameters:**
702728 * ** name** (* str* ) – Name of the search index in Redis.
703- * ** redis_client** (* Optional* * [ * * redis. Redis* * ] * ) – An
729+ * ** redis_client** (* Optional* * [ * * Redis* * ] * ) – An
704730 instantiated redis client.
705731 * ** redis_url** (* Optional* * [ * * str* * ] * ) – The URL of the Redis server to
706732 connect to.
@@ -872,11 +898,11 @@ results = await index.query(query)
872898
873899#### ` async search(*args, **kwargs) `
874900
875- Perform a search on this index.
901+ Perform an async search against the index.
876902
877- Wrapper around redis. search.Search that adds the index name
878- to the search query and passes along the rest of the arguments
879- to the redis-py ft.search() method.
903+ Wrapper around the search API that adds the index name
904+ to the query and passes along the rest of the arguments
905+ to the redis-py ft() .search() method.
880906
881907* ** Returns:**
882908 Raw Redis search results.
@@ -889,9 +915,9 @@ to the redis-py ft.search() method.
889915This method is deprecated; please provide connection parameters in \_\_ init_ \_ .
890916
891917* ** Parameters:**
892- ** redis_client** (* Redis* * |* * Redis* )
918+ ** redis_client** (* Redis* * |* * RedisCluster * * | * * Redis* * | * * RedisCluster * )
893919
894- #### ` property client: Redis | None `
920+ #### ` property client: Redis | RedisCluster | None `
895921
896922The underlying redis-py client object.
897923
0 commit comments