salvage: fix(opensearch) re-raise search errors (credit @yashwanth123 #6477) (#6519)

Co-authored-by: yashwanth123 <yashwanth123@users.noreply.github.com>
This commit is contained in:
Bartok
2026-07-24 18:19:26 +05:30
committed by GitHub
co-authored by yashwanth123
parent d6d89c987b
commit 01afdde3e7
2 changed files with 25 additions and 6 deletions
+7 -3
View File
@@ -248,7 +248,7 @@ class OpenSearchDB(VectorStoreBase):
return results
except Exception as e:
logger.error(f"Error during search: {e}", exc_info=True)
return []
raise
def keyword_search(self, query, top_k=5, filters=None):
"""Search for memories using BM25 keyword matching.
@@ -293,8 +293,12 @@ class OpenSearchDB(VectorStoreBase):
]
return results
except Exception as e:
logger.error(f"Error during keyword search: {e}")
return []
# Do NOT re-raise here: keyword_search() is a best-effort helper that
# search() may call to augment semantic results. Raising would crash
# the whole search() call on a keyword-only failure (regression per
# maintainer review on #6519). Log with exc_info and degrade to None.
logger.error(f"Error during keyword search: {e}", exc_info=True)
return None
def delete(self, vector_id: str) -> None:
"""Delete a vector by custom ID."""