@@ -85,6 +85,7 @@ class Database
8585 public const INDEX_HNSW_EUCLIDEAN = 'hnsw_euclidean ' ;
8686 public const INDEX_HNSW_COSINE = 'hnsw_cosine ' ;
8787 public const INDEX_HNSW_DOT = 'hnsw_dot ' ;
88+ public const INDEX_TRIGRAM = 'trigram ' ;
8889
8990 // Max limits
9091 public const MAX_INT = 2147483647 ;
@@ -1642,6 +1643,11 @@ public function createCollection(string $id, array $attributes = [], array $inde
16421643 $ this ->adapter ->getSupportForMultipleFulltextIndexes (),
16431644 $ this ->adapter ->getSupportForIdenticalIndexes (),
16441645 $ this ->adapter ->getSupportForIndexObject (),
1646+ $ this ->adapter ->getSupportForTrigramIndex (),
1647+ $ this ->adapter ->getSupportForSpatialAttributes (),
1648+ $ this ->adapter ->getSupportForIndex (),
1649+ $ this ->adapter ->getSupportForUniqueIndex (),
1650+ $ this ->adapter ->getSupportForFulltextIndex (),
16451651 );
16461652 foreach ($ indexes as $ index ) {
16471653 if (!$ validator ->isValid ($ index )) {
@@ -2786,7 +2792,12 @@ public function updateAttribute(string $collection, string $id, ?string $type =
27862792 $ this ->adapter ->getSupportForAttributes (),
27872793 $ this ->adapter ->getSupportForMultipleFulltextIndexes (),
27882794 $ this ->adapter ->getSupportForIdenticalIndexes (),
2789- $ this ->adapter ->getSupportForIndexObject ()
2795+ $ this ->adapter ->getSupportForIndexObject (),
2796+ $ this ->adapter ->getSupportForTrigramIndex (),
2797+ $ this ->adapter ->getSupportForSpatialAttributes (),
2798+ $ this ->adapter ->getSupportForIndex (),
2799+ $ this ->adapter ->getSupportForUniqueIndex (),
2800+ $ this ->adapter ->getSupportForFulltextIndex (),
27902801 );
27912802
27922803 foreach ($ indexes as $ index ) {
@@ -3661,7 +3672,7 @@ public function createIndex(string $collection, string $id, string $type, array
36613672 break ;
36623673
36633674 case self ::INDEX_OBJECT :
3664- if (!$ this ->adapter ->getSupportForIndexObject ()) {
3675+ if (!$ this ->adapter ->getSupportForObject ()) {
36653676 throw new DatabaseException ('Object indexes are not supported ' );
36663677 }
36673678 break ;
@@ -3722,7 +3733,12 @@ public function createIndex(string $collection, string $id, string $type, array
37223733 $ this ->adapter ->getSupportForAttributes (),
37233734 $ this ->adapter ->getSupportForMultipleFulltextIndexes (),
37243735 $ this ->adapter ->getSupportForIdenticalIndexes (),
3725- $ this ->adapter ->getSupportForIndexObject ()
3736+ $ this ->adapter ->getSupportForIndexObject (),
3737+ $ this ->adapter ->getSupportForTrigramIndex (),
3738+ $ this ->adapter ->getSupportForSpatialAttributes (),
3739+ $ this ->adapter ->getSupportForIndex (),
3740+ $ this ->adapter ->getSupportForUniqueIndex (),
3741+ $ this ->adapter ->getSupportForFulltextIndex (),
37263742 );
37273743 if (!$ validator ->isValid ($ index )) {
37283744 throw new IndexException ($ validator ->getDescription ());
0 commit comments