fix: restore Qdrant search in Admin UI (use query_points) & dedup collections
This commit is contained in:
@@ -56,13 +56,13 @@ def search_vectors(
|
||||
query_vector = embedding_service.embed_texts([query])[0]
|
||||
|
||||
# 2. Search Qdrant directly
|
||||
results = qdrant_client.search(
|
||||
results = qdrant_client.query_points(
|
||||
collection_name=collection,
|
||||
query_vector=query_vector,
|
||||
query=query_vector,
|
||||
limit=limit,
|
||||
with_payload=True,
|
||||
with_vectors=False
|
||||
)
|
||||
).points
|
||||
|
||||
# 3. Format
|
||||
formatted = []
|
||||
@@ -146,6 +146,8 @@ def list_collections(user = Depends(current_user)):
|
||||
client = get_qdrant_client()
|
||||
try:
|
||||
collections = client.get_collections()
|
||||
return {"collections": [c.name for c in collections.collections]}
|
||||
# Deduplicate and sort
|
||||
names = sorted(list(set([c.name for c in collections.collections])))
|
||||
return {"collections": names}
|
||||
except Exception as e:
|
||||
return {"error": str(e), "collections": []}
|
||||
|
||||
Reference in New Issue
Block a user