Skip to content

Commit d7a2900

Browse files
committed
transaction needs to be set to false, pipeline is OK tho
1 parent 8122d94 commit d7a2900

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

redisearch/auto_complete.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ def add_suggestions(self, *suggestions, **kwargs):
8484
8585
If kwargs['increment'] is true and the terms are already in the server's dictionary, we increment their scores
8686
"""
87-
pipe = self.redis.pipeline()
87+
# If Transaction is not set to false it will attempt a MULTI/EXEC which will error
88+
pipe = self.redis.pipeline(transaction=False)
8889
for sug in suggestions:
8990
args = [AutoCompleter.SUGADD_COMMAND, self.key, sug.string, sug.score]
9091
if kwargs.get('increment'):
@@ -142,4 +143,4 @@ def get_suggestions(self, prefix, fuzzy = False, num = 10, with_scores = False,
142143
return results
143144

144145
parser = SuggestionParser(with_scores, with_payloads, ret)
145-
return [s for s in parser]
146+
return [s for s in parser]

0 commit comments

Comments
 (0)