|
@@ -239,8 +239,7 @@ class WeaviateVector(BaseVector):
|
|
query_obj = self._client.query.get(collection_name, properties)
|
|
query_obj = self._client.query.get(collection_name, properties)
|
|
if kwargs.get("where_filter"):
|
|
if kwargs.get("where_filter"):
|
|
query_obj = query_obj.with_where(kwargs.get("where_filter"))
|
|
query_obj = query_obj.with_where(kwargs.get("where_filter"))
|
|
- if kwargs.get("additional"):
|
|
|
|
- query_obj = query_obj.with_additional(kwargs.get("additional"))
|
|
|
|
|
|
+ query_obj = query_obj.with_additional(["vector"])
|
|
properties = ['text']
|
|
properties = ['text']
|
|
result = query_obj.with_bm25(query=query, properties=properties).with_limit(kwargs.get('top_k', 2)).do()
|
|
result = query_obj.with_bm25(query=query, properties=properties).with_limit(kwargs.get('top_k', 2)).do()
|
|
if "errors" in result:
|
|
if "errors" in result:
|
|
@@ -248,7 +247,8 @@ class WeaviateVector(BaseVector):
|
|
docs = []
|
|
docs = []
|
|
for res in result["data"]["Get"][collection_name]:
|
|
for res in result["data"]["Get"][collection_name]:
|
|
text = res.pop(Field.TEXT_KEY.value)
|
|
text = res.pop(Field.TEXT_KEY.value)
|
|
- docs.append(Document(page_content=text, metadata=res))
|
|
|
|
|
|
+ additional = res.pop('_additional')
|
|
|
|
+ docs.append(Document(page_content=text, vector=additional['vector'], metadata=res))
|
|
return docs
|
|
return docs
|
|
|
|
|
|
def _default_schema(self, index_name: str) -> dict:
|
|
def _default_schema(self, index_name: str) -> dict:
|