@@ -555,8 +555,8 @@ public function testObjectAttributeGinIndex(): void
555555 // Create object attribute
556556 $ this ->assertEquals (true , $ database ->createAttribute ($ collectionId , 'data ' , Database::TYPE_OBJECT , 0 , false ));
557557
558- // Test 1: Create GIN index on object attribute
559- $ ginIndex = $ database ->createIndex ($ collectionId , 'idx_data_gin ' , Database::INDEX_GIN , ['data ' ]);
558+ // Test 1: Create Object index on object attribute
559+ $ ginIndex = $ database ->createIndex ($ collectionId , 'idx_data_gin ' , Database::Index_Object , ['data ' ]);
560560 $ this ->assertTrue ($ ginIndex );
561561
562562 // Test 2: Create documents with JSONB data
@@ -590,7 +590,7 @@ public function testObjectAttributeGinIndex(): void
590590 $ results = $ database ->find ($ collectionId , [
591591 Query::equal ('data ' , [['env ' => 'production ' ]])
592592 ]);
593- $ this ->assertCount (0 , $ results ); // Note: GIN index doesn't make equal queries work differently
593+ $ this ->assertCount (0 , $ results ); // Note: Object index doesn't make equal queries work differently
594594
595595 // Test 4: Query with contains on indexed JSONB column
596596 $ results = $ database ->find ($ collectionId , [
@@ -599,49 +599,49 @@ public function testObjectAttributeGinIndex(): void
599599 $ this ->assertCount (1 , $ results );
600600 $ this ->assertEquals ('gin1 ' , $ results [0 ]->getId ());
601601
602- // Test 5: Verify GIN index improves performance for containment queries
602+ // Test 5: Verify Object index improves performance for containment queries
603603 $ results = $ database ->find ($ collectionId , [
604604 Query::contains ('data ' , [['tags ' => 'kotlin ' ]])
605605 ]);
606606 $ this ->assertCount (1 , $ results );
607607 $ this ->assertEquals ('gin2 ' , $ results [0 ]->getId ());
608608
609- // Test 6: Try to create GIN index on non-object attribute (should fail)
609+ // Test 6: Try to create Object index on non-object attribute (should fail)
610610 $ database ->createAttribute ($ collectionId , 'name ' , Database::VAR_STRING , 255 , false );
611611
612612 $ exceptionThrown = false ;
613613 try {
614- $ database ->createIndex ($ collectionId , 'idx_name_gin ' , Database::INDEX_GIN , ['name ' ]);
614+ $ database ->createIndex ($ collectionId , 'idx_name_gin ' , Database::Index_Object , ['name ' ]);
615615 } catch (\Exception $ e ) {
616616 $ exceptionThrown = true ;
617617 $ this ->assertInstanceOf (IndexException::class, $ e );
618- $ this ->assertStringContainsString ('GIN index can only be created on object attributes ' , $ e ->getMessage ());
618+ $ this ->assertStringContainsString ('Object index can only be created on object attributes ' , $ e ->getMessage ());
619619 }
620- $ this ->assertTrue ($ exceptionThrown , 'Expected Index exception for GIN index on non-object attribute ' );
620+ $ this ->assertTrue ($ exceptionThrown , 'Expected Index exception for Object index on non-object attribute ' );
621621
622- // Test 7: Try to create GIN index on multiple attributes (should fail)
622+ // Test 7: Try to create Object index on multiple attributes (should fail)
623623 $ database ->createAttribute ($ collectionId , 'metadata ' , Database::TYPE_OBJECT , 0 , false );
624624
625625 $ exceptionThrown = false ;
626626 try {
627- $ database ->createIndex ($ collectionId , 'idx_multi_gin ' , Database::INDEX_GIN , ['data ' , 'metadata ' ]);
627+ $ database ->createIndex ($ collectionId , 'idx_multi_gin ' , Database::Index_Object , ['data ' , 'metadata ' ]);
628628 } catch (\Exception $ e ) {
629629 $ exceptionThrown = true ;
630630 $ this ->assertInstanceOf (IndexException::class, $ e );
631- $ this ->assertStringContainsString ('GIN index can be created on a single object attribute ' , $ e ->getMessage ());
631+ $ this ->assertStringContainsString ('Object index can be created on a single object attribute ' , $ e ->getMessage ());
632632 }
633- $ this ->assertTrue ($ exceptionThrown , 'Expected Index exception for GIN index on multiple attributes ' );
633+ $ this ->assertTrue ($ exceptionThrown , 'Expected Index exception for Object index on multiple attributes ' );
634634
635- // Test 8: Try to create GIN index with orders (should fail)
635+ // Test 8: Try to create Object index with orders (should fail)
636636 $ exceptionThrown = false ;
637637 try {
638- $ database ->createIndex ($ collectionId , 'idx_ordered_gin ' , Database::INDEX_GIN , ['metadata ' ], [], [Database::ORDER_ASC ]);
638+ $ database ->createIndex ($ collectionId , 'idx_ordered_gin ' , Database::Index_Object , ['metadata ' ], [], [Database::ORDER_ASC ]);
639639 } catch (\Exception $ e ) {
640640 $ exceptionThrown = true ;
641641 $ this ->assertInstanceOf (IndexException::class, $ e );
642- $ this ->assertStringContainsString ('GIN indexes do not support explicit orders ' , $ e ->getMessage ());
642+ $ this ->assertStringContainsString ('Object indexes do not support explicit orders ' , $ e ->getMessage ());
643643 }
644- $ this ->assertTrue ($ exceptionThrown , 'Expected Index exception for GIN index with orders ' );
644+ $ this ->assertTrue ($ exceptionThrown , 'Expected Index exception for Object index with orders ' );
645645
646646 // Clean up
647647 $ database ->deleteCollection ($ collectionId );
0 commit comments