diff --git a/core/indexing/LanceDbIndex.ts b/core/indexing/LanceDbIndex.ts index 7c4787529..420f33eb8 100644 --- a/core/indexing/LanceDbIndex.ts +++ b/core/indexing/LanceDbIndex.ts @@ -12,6 +12,7 @@ import { } from "../index.js"; import { getBasename } from "../util/index.js"; import { getLanceDbPath, migrate } from "../util/paths.js"; +import { Telemetry } from "../util/posthog.js"; import { chunkDocument, shouldChunk } from "./chunk/chunk.js"; import { DatabaseConnection, SqliteDb, tagToString } from "./refreshIndex.js"; import { @@ -417,6 +418,15 @@ export class LanceDbIndex implements CodebaseIndex { return []; } + if (!db.search) { + // Unclear why this is happening + console.debug( + "Error retrieving from vectordb: db.search isn't a function", + ); + Telemetry.capture("db_search_not_a_function", {}, false); + return []; + } + let query = db.search(vector); if (directory) { // seems like lancedb is only post-filtering, so have to return a bunch of results and slice after