@@ -41,20 +41,20 @@ final class HybridStore implements ManagedStoreInterface, StoreInterface
4141 private readonly TextSearchStrategyInterface $ textSearchStrategy ;
4242
4343 /**
44- * @param string $vectorFieldName Name of the vector field
45- * @param string $contentFieldName Name of the text field for FTS
46- * @param float $semanticRatio Ratio between semantic and keyword search (0.0 to 1.0)
47- * @param Distance $distance Distance metric for vector similarity
48- * @param string $language PostgreSQL text search configuration
49- * @param TextSearchStrategyInterface|null $textSearchStrategy Text search strategy (defaults to native PostgreSQL)
50- * @param ReciprocalRankFusion|null $rrf RRF calculator (defaults to k=60, normalized)
51- * @param float|null $defaultMaxScore Default max distance for vector search
52- * @param float|null $defaultMinScore Default min RRF score threshold
53- * @param float $fuzzyPrimaryThreshold Primary threshold for fuzzy matching
54- * @param float $fuzzySecondaryThreshold Secondary threshold for fuzzy matching
55- * @param float $fuzzyStrictThreshold Strict threshold for double validation
56- * @param float $fuzzyWeight Weight of fuzzy matching (0.0 to 1.0)
57- * @param array<string, array{metadata_key: string, boost?: float}> $searchableAttributes Searchable attributes with boosting config
44+ * @param string $vectorFieldName Name of the vector field
45+ * @param string $contentFieldName Name of the text field for FTS
46+ * @param float $semanticRatio Ratio between semantic and keyword search (0.0 to 1.0)
47+ * @param Distance $distance Distance metric for vector similarity
48+ * @param string $language PostgreSQL text search configuration
49+ * @param TextSearchStrategyInterface|null $textSearchStrategy Text search strategy (defaults to native PostgreSQL)
50+ * @param ReciprocalRankFusion|null $rrf RRF calculator (defaults to k=60, normalized)
51+ * @param float|null $defaultMaxScore Default max distance for vector search
52+ * @param float|null $defaultMinScore Default min RRF score threshold
53+ * @param float $fuzzyPrimaryThreshold Primary threshold for fuzzy matching
54+ * @param float $fuzzySecondaryThreshold Secondary threshold for fuzzy matching
55+ * @param float $fuzzyStrictThreshold Strict threshold for double validation
56+ * @param float $fuzzyWeight Weight of fuzzy matching (0.0 to 1.0)
57+ * @param array<string, array{metadata_key: string, boost?: float}> $searchableAttributes Searchable attributes with boosting config
5858 */
5959 public function __construct (
6060 private readonly \PDO $ connection ,
@@ -75,17 +75,11 @@ public function __construct(
7575 private readonly array $ searchableAttributes = [],
7676 ) {
7777 if ($ semanticRatio < 0.0 || $ semanticRatio > 1.0 ) {
78- throw new InvalidArgumentException (\sprintf (
79- 'The semantic ratio must be between 0.0 and 1.0, "%s" given. ' ,
80- $ semanticRatio
81- ));
78+ throw new InvalidArgumentException (\sprintf ('The semantic ratio must be between 0.0 and 1.0, "%s" given. ' , $ semanticRatio ));
8279 }
8380
8481 if ($ fuzzyWeight < 0.0 || $ fuzzyWeight > 1.0 ) {
85- throw new InvalidArgumentException (\sprintf (
86- 'The fuzzy weight must be between 0.0 and 1.0, "%s" given. ' ,
87- $ fuzzyWeight
88- ));
82+ throw new InvalidArgumentException (\sprintf ('The fuzzy weight must be between 0.0 and 1.0, "%s" given. ' , $ fuzzyWeight ));
8983 }
9084
9185 $ this ->textSearchStrategy = $ textSearchStrategy ?? new PostgresTextSearchStrategy ();
@@ -314,11 +308,11 @@ private function createSearchTextTrigger(): void
314308
315309 $ this ->connection ->exec (
316310 \sprintf (
317- " DROP TRIGGER IF EXISTS trigger_update_search_text ON %s;
311+ ' DROP TRIGGER IF EXISTS trigger_update_search_text ON %s;
318312 CREATE TRIGGER trigger_update_search_text
319313 BEFORE INSERT OR UPDATE ON %s
320314 FOR EACH ROW
321- EXECUTE FUNCTION update_search_text(); " ,
315+ EXECUTE FUNCTION update_search_text(); ' ,
322316 $ this ->tableName ,
323317 $ this ->tableName ,
324318 ),
@@ -353,10 +347,7 @@ private function createTsvectorIndexes(): void
353347 private function validateSemanticRatio (float $ ratio ): float
354348 {
355349 if ($ ratio < 0.0 || $ ratio > 1.0 ) {
356- throw new InvalidArgumentException (\sprintf (
357- 'The semantic ratio must be between 0.0 and 1.0, "%s" given. ' ,
358- $ ratio
359- ));
350+ throw new InvalidArgumentException (\sprintf ('The semantic ratio must be between 0.0 and 1.0, "%s" given. ' , $ ratio ));
360351 }
361352
362353 return $ ratio ;
0 commit comments