From 5c999b6c7c7116a558193241bf4a270eae1c2e65 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Fri, 26 Jan 2024 18:45:49 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20distance=20metric?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/indexing/LanceDbIndex.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/indexing/LanceDbIndex.ts b/core/indexing/LanceDbIndex.ts index feafc3a3a..fbeecc25f 100644 --- a/core/indexing/LanceDbIndex.ts +++ b/core/indexing/LanceDbIndex.ts @@ -283,7 +283,7 @@ export class LanceDbIndex implements CodebaseIndex { } allResults = allResults - .sort((a, b) => b._distance - a._distance) + .sort((a, b) => a._distance - b._distance) .slice(0, n); const sqliteDb = await SqliteDb.get();