From 771889ad7f6d910f89a9a09b4328471eebb79cf5 Mon Sep 17 00:00:00 2001 From: Anush Date: Fri, 7 Jun 2024 01:48:01 +0530 Subject: [PATCH] [FIX] Incorrect vectors count with Qdrant (#1561) Co-authored-by: Timothy Carambat --- server/package.json | 2 +- server/utils/vectorDbProviders/qdrant/index.js | 2 +- server/yarn.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/package.json b/server/package.json index b107695c..1b0ba280 100644 --- a/server/package.json +++ b/server/package.json @@ -32,7 +32,7 @@ "@langchain/textsplitters": "0.0.0", "@pinecone-database/pinecone": "^2.0.1", "@prisma/client": "5.3.1", - "@qdrant/js-client-rest": "^1.4.0", + "@qdrant/js-client-rest": "^1.9.0", "@xenova/transformers": "^2.14.0", "@zilliz/milvus2-sdk-node": "^2.3.5", "archiver": "^5.3.1", diff --git a/server/utils/vectorDbProviders/qdrant/index.js b/server/utils/vectorDbProviders/qdrant/index.js index ff55c06f..77945915 100644 --- a/server/utils/vectorDbProviders/qdrant/index.js +++ b/server/utils/vectorDbProviders/qdrant/index.js @@ -95,7 +95,7 @@ const QDrant = { return { name: namespace, ...collection, - vectorCount: collection.vectors_count, + vectorCount: (await client.count(namespace, { exact: true })).count, }; }, hasNamespace: async function (namespace = null) { diff --git a/server/yarn.lock b/server/yarn.lock index d274e574..c6cf4c2c 100644 --- a/server/yarn.lock +++ b/server/yarn.lock @@ -1036,7 +1036,7 @@ resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== -"@qdrant/js-client-rest@^1.4.0": +"@qdrant/js-client-rest@^1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@qdrant/js-client-rest/-/js-client-rest-1.9.0.tgz#deef8acb520f47f9db1c1517758ccf88c12e69fe" integrity sha512-YiX/IskbRCoAY2ujyPDI6FBcO0ygAS4pgkGaJ7DcrJFh4SZV2XHs+u0KM7mO72RWJn1eJQFF2PQwxG+401xxJg==