1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-10-23 18:48:37 +03:00

Vectors: Added command to regenerate for all

Also made models configurable.
Tested system scales via 86k vector entries.
This commit is contained in:
Dan Brown
2025-03-25 19:38:32 +00:00
parent b9ecf55e1f
commit e611b3239e
6 changed files with 68 additions and 10 deletions

View File

@@ -21,6 +21,8 @@ return new class extends Migration
});
$table = DB::getTablePrefix() . 'search_vectors';
// TODO - Vector size might need to be dynamic
DB::statement("ALTER TABLE {$table} ADD COLUMN (embedding VECTOR(1536) NOT NULL)");
DB::statement("ALTER TABLE {$table} ADD VECTOR INDEX (embedding) DISTANCE=cosine");
}