Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Fix cursor error with multithreaded keyword search, closes #1039

davidmezzetti834e4eb60da7
diff --git a/src/python/txtai/scoring/terms.py b/src/python/txtai/scoring/terms.py
index 8d2cabb9..8b4566d0 100644
--- a/src/python/txtai/scoring/terms.py
+++ b/src/python/txtai/scoring/terms.py
@@ -182,7 +182,8 @@ class Terms:
scores = np.zeros(len(self.ids), dtype=np.float32)
# Apply term expansion
- terms = self.expand(terms)
+ with self.lock:
+ terms = self.expand(terms)
# Debug logging for terms
logger.debug(" ".join(["%s"] * len(terms)), *terms)