If your MySQL is new enough (starting with MySQL 5.6 / MariaDB 10), you can try converting that table to InnoDB:
ALTER TABLE searchindex ENGINE=InnoDB; On Wed, Jan 18, 2017 at 3:56 PM, Jean Valjean <[email protected]> wrote: > I use Dreamhost, and for some reason it has a glitch that is making my > searchindex table crash all the time. About one out of every 10 searches, > when I try to run a search, it says that searchindex "is marked as crashed > and should be repaired". > > I came up with the workaround below, so that the user can just go to the > existing page Project:Repair and it will repair the table. But that's > inconvenient. I'd rather come up with something that will just repair the > table whenever a search is run, before any search queries are done on the > database. Got any ideas? Thanks. > > $wgRepairedTable = false; > $wgHooks['BeforePageDisplay'][] = 'repairtable'; > function repairtable( $out, $skin ) { > global $wgRepairedTable; > if ( $out->getPageTitle() === 'Project:Repair' && $wgRepairedTable > === false ) { > $wgRepairedTable = true; > $dbw = wfGetDB( DB_MASTER ); > $dbw->query( "REPAIR TABLE `searchindex`" ); > echo 'searchindex table repaired'; > } > return true; > } > _______________________________________________ > MediaWiki-l mailing list > To unsubscribe, go to: > https://lists.wikimedia.org/mailman/listinfo/mediawiki-l > -- Best regards, Max Semenik ([[User:MaxSem]]) _______________________________________________ MediaWiki-l mailing list To unsubscribe, go to: https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
