Skip to content

Commit

Permalink
Include context on how we distribute search query load on redis in ca…
Browse files Browse the repository at this point in the history
…se of cluster api enabled
  • Loading branch information
filipecosta90 committed Dec 17, 2023
1 parent 9dc71d5 commit 4c9d922
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions engine/clients/redis/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def init_client(cls, host, distance, connection_params: dict, search_params: dic
cls.search_params = search_params
cls.knn_conditions = "EF_RUNTIME $EF"
cls._is_cluster = True if REDIS_CLUSTER else False
# In the case of CLUSTER API enabled we randomly select the starting primary shard
# when doing the client initialization to evenly distribute the load among the cluster
cls.conns = [cls.client]
if cls._is_cluster:
cls.conns = [
Expand Down

0 comments on commit 4c9d922

Please sign in to comment.