@@ -539,6 +539,14 @@ public function testSearchIndex(): void
539
539
self ::assertSame ('search ' , $ index ['type ' ]);
540
540
self ::assertFalse ($ index ['latestDefinition ' ]['mappings ' ]['dynamic ' ]);
541
541
self ::assertSame ('lucene.whitespace ' , $ index ['latestDefinition ' ]['mappings ' ]['fields ' ]['foo ' ]['analyzer ' ]);
542
+
543
+ // Drop the index using default name
544
+ Schema::table ('newcollection ' , function (Blueprint $ collection ) {
545
+ $ collection ->dropSearchIndex ();
546
+ });
547
+
548
+ $ index = $ this ->getSearchIndex ('newcollection ' , 'default ' );
549
+ self ::assertNull ($ index );
542
550
}
543
551
544
552
public function testVectorSearchIndex ()
@@ -559,6 +567,14 @@ public function testVectorSearchIndex()
559
567
self ::assertSame ('vector ' , $ index ['name ' ]);
560
568
self ::assertSame ('vectorSearch ' , $ index ['type ' ]);
561
569
self ::assertSame ('vector ' , $ index ['latestDefinition ' ]['fields ' ][0 ]['type ' ]);
570
+
571
+ // Drop the index
572
+ Schema::table ('newcollection ' , function (Blueprint $ collection ) {
573
+ $ collection ->dropSearchIndex ('vector ' );
574
+ });
575
+
576
+ $ index = $ this ->getSearchIndex ('newcollection ' , 'vector ' );
577
+ self ::assertNull ($ index );
562
578
}
563
579
564
580
protected function assertIndexExists (string $ collection , string $ name ): IndexInfo
0 commit comments