add vector field for other vectordb (#7051)

This commit is contained in:
Jyong
2024-08-07 17:14:03 +08:00
committed by GitHub
parent aad02113c6
commit 80c94f02e9
10 changed files with 23 additions and 14 deletions

View File

@@ -192,7 +192,9 @@ class OpenSearchVector(BaseVector):
docs = []
for hit in response['hits']['hits']:
metadata = hit['_source'].get(Field.METADATA_KEY.value)
doc = Document(page_content=hit['_source'].get(Field.CONTENT_KEY.value), metadata=metadata)
vector = hit['_source'].get(Field.VECTOR.value)
page_content = hit['_source'].get(Field.CONTENT_KEY.value)
doc = Document(page_content=page_content, vector=vector, metadata=metadata)
docs.append(doc)
return docs