mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-08-29 04:26:20 +00:00
fix(vector_store): normalize QdrantStore.search_vectors() to return "metadata"
QdrantStore.search_vectors() returned results keyed by "payload" while HybridSearch and PineconeStore both expect/return "metadata". This silently dropped metadata from Qdrant results and caused HybridSearch.filter_by_metadata to reject every candidate when a filter was applied (empty result sets). Fixes #840
This commit is contained in:
@@ -165,7 +165,7 @@ class QdrantCollection:
|
||||
{
|
||||
"id": result.id,
|
||||
"score": result.score,
|
||||
"payload": result.payload or {},
|
||||
"metadata": result.payload or {},
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -232,6 +232,16 @@ class TestVectorStoreDeepDive(unittest.TestCase):
|
||||
self.assertEqual(len(results), 1)
|
||||
self.assertEqual(results[0]["id"], "vec_1")
|
||||
|
||||
self.assertIn("metadata", results[0])
|
||||
self.assertNotIn("payload", results[0])
|
||||
self.assertEqual(results[0]["metadata"], {"type": "a"})
|
||||
|
||||
hybrid = HybridSearch()
|
||||
matched = hybrid.filter_by_metadata(
|
||||
results, MetadataFilter().eq("type", "a")
|
||||
)
|
||||
self.assertEqual(len(matched), 1)
|
||||
|
||||
@patch('semantica.vector_store.weaviate_store.weaviate')
|
||||
@patch('semantica.vector_store.weaviate_store.MetadataQuery')
|
||||
@patch('semantica.vector_store.weaviate_store.WEAVIATE_AVAILABLE', True)
|
||||
|
||||
Reference in New Issue
Block a user