1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-06 12:02:45 +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 0ffcb3d4aa
commit a023bed41d
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");
}