temporary fix for unknown lancedb edge case
This commit is contained in:
parent
6d15e14893
commit
2bd6b40ead
1 changed files with 10 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue