mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
updated query function with scroll too
This commit is contained in:
parent
88abd01b87
commit
8af9ad3f30
2 changed files with 6 additions and 6 deletions
|
|
@ -179,12 +179,12 @@ class QdrantClient(VectorDBBase):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
points = self.client.query_points(
|
points = self.client.scroll(
|
||||||
collection_name=f"{self.collection_prefix}_{collection_name}",
|
collection_name=f"{self.collection_prefix}_{collection_name}",
|
||||||
query_filter=models.Filter(should=field_conditions),
|
scroll_filter=models.Filter(should=field_conditions),
|
||||||
limit=limit,
|
limit=limit,
|
||||||
)
|
)
|
||||||
return self._result_to_get_result(points.points)
|
return self._result_to_get_result(points[0])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.exception(f"Error querying a collection '{collection_name}': {e}")
|
log.exception(f"Error querying a collection '{collection_name}': {e}")
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
|
|
@ -289,12 +289,12 @@ class QdrantClient(VectorDBBase):
|
||||||
tenant_filter = _tenant_filter(tenant_id)
|
tenant_filter = _tenant_filter(tenant_id)
|
||||||
field_conditions = [_metadata_filter(k, v) for k, v in filter.items()]
|
field_conditions = [_metadata_filter(k, v) for k, v in filter.items()]
|
||||||
combined_filter = models.Filter(must=[tenant_filter, *field_conditions])
|
combined_filter = models.Filter(must=[tenant_filter, *field_conditions])
|
||||||
points = self.client.query_points(
|
points = self.client.scroll(
|
||||||
collection_name=mt_collection,
|
collection_name=mt_collection,
|
||||||
query_filter=combined_filter,
|
scroll_filter=combined_filter,
|
||||||
limit=limit,
|
limit=limit,
|
||||||
)
|
)
|
||||||
return self._result_to_get_result(points.points)
|
return self._result_to_get_result(points[0])
|
||||||
|
|
||||||
def get(self, collection_name: str) -> Optional[GetResult]:
|
def get(self, collection_name: str) -> Optional[GetResult]:
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue