@@ -551,6 +551,14 @@ public function testSearchIndex(): void
551
551
self ::assertSame ('search ' , $ index ['type ' ]);
552
552
self ::assertFalse ($ index ['latestDefinition ' ]['mappings ' ]['dynamic ' ]);
553
553
self ::assertSame ('lucene.whitespace ' , $ index ['latestDefinition ' ]['mappings ' ]['fields ' ]['foo ' ]['analyzer ' ]);
554
+
555
+ // Drop the index using default name
556
+ Schema::table ('newcollection ' , function (Blueprint $ collection ) {
557
+ $ collection ->dropSearchIndex ();
558
+ });
559
+
560
+ $ index = $ this ->getSearchIndex ('newcollection ' , 'default ' );
561
+ self ::assertNull ($ index );
554
562
}
555
563
556
564
public function testVectorSearchIndex ()
@@ -571,6 +579,14 @@ public function testVectorSearchIndex()
571
579
self ::assertSame ('vector ' , $ index ['name ' ]);
572
580
self ::assertSame ('vectorSearch ' , $ index ['type ' ]);
573
581
self ::assertSame ('vector ' , $ index ['latestDefinition ' ]['fields ' ][0 ]['type ' ]);
582
+
583
+ // Drop the index
584
+ Schema::table ('newcollection ' , function (Blueprint $ collection ) {
585
+ $ collection ->dropSearchIndex ('vector ' );
586
+ });
587
+
588
+ $ index = $ this ->getSearchIndex ('newcollection ' , 'vector ' );
589
+ self ::assertNull ($ index );
574
590
}
575
591
576
592
protected function getIndex (string $ collection , string $ name )
0 commit comments