1313
1414use PHPUnit \Framework \TestCase ;
1515use Symfony \AI \Platform \Vector \Vector ;
16- use Symfony \AI \Store \Bridge \Postgres \PostgresHybridStore ;
16+ use Symfony \AI \Store \Bridge \Postgres \HybridStore ;
1717use Symfony \AI \Store \Document \Metadata ;
1818use Symfony \AI \Store \Document \VectorDocument ;
1919use Symfony \AI \Store \Exception \InvalidArgumentException ;
2020use Symfony \Component \Uid \Uuid ;
2121
22- final class PostgresHybridStoreTest extends TestCase
22+ final class HybridStoreTest extends TestCase
2323{
2424 public function testConstructorValidatesSemanticRatio ()
2525 {
2626 $ this ->expectException (InvalidArgumentException::class);
2727 $ this ->expectExceptionMessage ('The semantic ratio must be between 0.0 and 1.0 ' );
2828
2929 $ pdo = $ this ->createMock (\PDO ::class);
30- new PostgresHybridStore ($ pdo , 'test_table ' , semanticRatio: 1.5 );
30+ new HybridStore ($ pdo , 'test_table ' , semanticRatio: 1.5 );
3131 }
3232
3333 public function testConstructorValidatesNegativeSemanticRatio ()
@@ -36,13 +36,13 @@ public function testConstructorValidatesNegativeSemanticRatio()
3636 $ this ->expectExceptionMessage ('The semantic ratio must be between 0.0 and 1.0 ' );
3737
3838 $ pdo = $ this ->createMock (\PDO ::class);
39- new PostgresHybridStore ($ pdo , 'test_table ' , semanticRatio: -0.5 );
39+ new HybridStore ($ pdo , 'test_table ' , semanticRatio: -0.5 );
4040 }
4141
4242 public function testSetupCreatesTableWithFullTextSearchSupport ()
4343 {
4444 $ pdo = $ this ->createMock (\PDO ::class);
45- $ store = new PostgresHybridStore ($ pdo , 'hybrid_table ' );
45+ $ store = new HybridStore ($ pdo , 'hybrid_table ' );
4646
4747 $ pdo ->expects ($ this ->exactly (4 ))
4848 ->method ('exec ' )
@@ -75,7 +75,7 @@ public function testAddDocument()
7575 $ pdo = $ this ->createMock (\PDO ::class);
7676 $ statement = $ this ->createMock (\PDOStatement::class);
7777
78- $ store = new PostgresHybridStore ($ pdo , 'hybrid_table ' );
78+ $ store = new HybridStore ($ pdo , 'hybrid_table ' );
7979
8080 $ expectedSql = 'INSERT INTO hybrid_table (id, metadata, content, embedding)
8181 VALUES (:id, :metadata, :content, :vector)
@@ -112,7 +112,7 @@ public function testPureVectorSearch()
112112 $ pdo = $ this ->createMock (\PDO ::class);
113113 $ statement = $ this ->createMock (\PDOStatement::class);
114114
115- $ store = new PostgresHybridStore ($ pdo , 'hybrid_table ' , semanticRatio: 1.0 );
115+ $ store = new HybridStore ($ pdo , 'hybrid_table ' , semanticRatio: 1.0 );
116116
117117 $ expectedSql = 'SELECT id, embedding AS embedding, metadata, (embedding <-> :embedding) AS score
118118 FROM hybrid_table
@@ -157,7 +157,7 @@ public function testPureKeywordSearch()
157157 $ pdo = $ this ->createMock (\PDO ::class);
158158 $ statement = $ this ->createMock (\PDOStatement::class);
159159
160- $ store = new PostgresHybridStore ($ pdo , 'hybrid_table ' , semanticRatio: 0.0 );
160+ $ store = new HybridStore ($ pdo , 'hybrid_table ' , semanticRatio: 0.0 );
161161
162162 $ expectedSql = "SELECT id, embedding AS embedding, metadata,
163163 (1.0 / (1.0 + ts_rank_cd(content_tsv, websearch_to_tsquery('simple', :query)))) AS score
@@ -204,7 +204,7 @@ public function testHybridSearchWithRRF()
204204 $ pdo = $ this ->createMock (\PDO ::class);
205205 $ statement = $ this ->createMock (\PDOStatement::class);
206206
207- $ store = new PostgresHybridStore ($ pdo , 'hybrid_table ' , semanticRatio: 0.5 , rrfK: 60 );
207+ $ store = new HybridStore ($ pdo , 'hybrid_table ' , semanticRatio: 0.5 , rrfK: 60 );
208208
209209 $ pdo ->expects ($ this ->once ())
210210 ->method ('prepare ' )
@@ -252,7 +252,7 @@ public function testQueryWithDefaultMaxScore()
252252 $ pdo = $ this ->createMock (\PDO ::class);
253253 $ statement = $ this ->createMock (\PDOStatement::class);
254254
255- $ store = new PostgresHybridStore (
255+ $ store = new HybridStore (
256256 $ pdo ,
257257 'hybrid_table ' ,
258258 semanticRatio: 1.0 ,
@@ -291,7 +291,7 @@ public function testQueryWithMaxScoreOverride()
291291 $ pdo = $ this ->createMock (\PDO ::class);
292292 $ statement = $ this ->createMock (\PDOStatement::class);
293293
294- $ store = new PostgresHybridStore (
294+ $ store = new HybridStore (
295295 $ pdo ,
296296 'hybrid_table ' ,
297297 semanticRatio: 1.0 ,
@@ -324,7 +324,7 @@ public function testQueryWithCustomLanguage()
324324 $ pdo = $ this ->createMock (\PDO ::class);
325325 $ statement = $ this ->createMock (\PDOStatement::class);
326326
327- $ store = new PostgresHybridStore ($ pdo , 'hybrid_table ' , semanticRatio: 0.0 , language: 'french ' );
327+ $ store = new HybridStore ($ pdo , 'hybrid_table ' , semanticRatio: 0.0 , language: 'french ' );
328328
329329 $ pdo ->expects ($ this ->once ())
330330 ->method ('prepare ' )
@@ -351,7 +351,7 @@ public function testQueryWithCustomRRFK()
351351 $ pdo = $ this ->createMock (\PDO ::class);
352352 $ statement = $ this ->createMock (\PDOStatement::class);
353353
354- $ store = new PostgresHybridStore ($ pdo , 'hybrid_table ' , semanticRatio: 0.5 , rrfK: 100 );
354+ $ store = new HybridStore ($ pdo , 'hybrid_table ' , semanticRatio: 0.5 , rrfK: 100 );
355355
356356 $ pdo ->expects ($ this ->once ())
357357 ->method ('prepare ' )
@@ -377,7 +377,7 @@ public function testQueryWithCustomRRFK()
377377 public function testQueryInvalidSemanticRatioInOptions ()
378378 {
379379 $ pdo = $ this ->createMock (\PDO ::class);
380- $ store = new PostgresHybridStore ($ pdo , 'hybrid_table ' );
380+ $ store = new HybridStore ($ pdo , 'hybrid_table ' );
381381
382382 $ this ->expectException (InvalidArgumentException::class);
383383 $ this ->expectExceptionMessage ('The semantic ratio must be between 0.0 and 1.0 ' );
@@ -388,7 +388,7 @@ public function testQueryInvalidSemanticRatioInOptions()
388388 public function testDrop ()
389389 {
390390 $ pdo = $ this ->createMock (\PDO ::class);
391- $ store = new PostgresHybridStore ($ pdo , 'hybrid_table ' );
391+ $ store = new HybridStore ($ pdo , 'hybrid_table ' );
392392
393393 $ pdo ->expects ($ this ->once ())
394394 ->method ('exec ' )
@@ -402,7 +402,7 @@ public function testQueryWithCustomLimit()
402402 $ pdo = $ this ->createMock (\PDO ::class);
403403 $ statement = $ this ->createMock (\PDOStatement::class);
404404
405- $ store = new PostgresHybridStore ($ pdo , 'hybrid_table ' , semanticRatio: 1.0 );
405+ $ store = new HybridStore ($ pdo , 'hybrid_table ' , semanticRatio: 1.0 );
406406
407407 $ pdo ->expects ($ this ->once ())
408408 ->method ('prepare ' )
@@ -429,7 +429,7 @@ public function testAddMultipleDocuments()
429429 $ pdo = $ this ->createMock (\PDO ::class);
430430 $ statement = $ this ->createMock (\PDOStatement::class);
431431
432- $ store = new PostgresHybridStore ($ pdo , 'hybrid_table ' );
432+ $ store = new HybridStore ($ pdo , 'hybrid_table ' );
433433
434434 $ pdo ->expects ($ this ->once ())
435435 ->method ('prepare ' )
@@ -469,7 +469,7 @@ public function testPureKeywordSearchReturnsEmptyWhenNoMatch()
469469 $ pdo = $ this ->createMock (\PDO ::class);
470470 $ statement = $ this ->createMock (\PDOStatement::class);
471471
472- $ store = new PostgresHybridStore ($ pdo , 'hybrid_table ' , semanticRatio: 0.0 );
472+ $ store = new HybridStore ($ pdo , 'hybrid_table ' , semanticRatio: 0.0 );
473473
474474 $ pdo ->expects ($ this ->once ())
475475 ->method ('prepare ' )
0 commit comments