]> BookStack Code Mirror - bookstack/blobdiff - app/Search/Vectors/VectorSearchRunner.php
Vectors: Added command to regenerate for all
[bookstack] / app / Search / Vectors / VectorSearchRunner.php
index db28779e403c573250673958c26e8370b65a7627..53b1a4bd6962293cf045bba7d5ae716290aae353 100644 (file)
@@ -19,6 +19,7 @@ class VectorSearchRunner
         $topMatches = SearchVector::query()->select('text', 'entity_type', 'entity_id')
             ->selectRaw('VEC_DISTANCE_COSINE(VEC_FROMTEXT("[' . implode(',', $queryVector) . ']"), embedding) as distance')
             ->orderBy('distance', 'asc')
+            ->having('distance', '<', 0.6)
             ->limit(10)
             ->get();