Complain if use asks for page that's not archived
[lhc/web/wiklou.git] / maintenance / rebuildtextindex.inc
index dacec07..f0e20f0 100644 (file)
@@ -8,9 +8,11 @@
 
 function dropTextIndex()
 {
-       echo "Dropping index...\n";
-       $sql = "ALTER TABLE searchindex DROP INDEX si_title, DROP INDEX si_text";
-       $res = wfQuery($sql, DB_WRITE, "dropTextIndex" );
+       if ( wfIndexExists( "searchindex", "si_title" ) ) {
+               echo "Dropping index...\n";
+               $sql = "ALTER TABLE searchindex DROP INDEX si_title, DROP INDEX si_text";
+               $res = wfQuery($sql, DB_WRITE, "dropTextIndex" );
+       }
 }
 
 function createTextIndex()