XF 2.1 xf_search_index problems

BoyG

Member
I'm receiving a report that the xf_search_index table of the xfdb database has crashed.
I'm trying to repair it via phpmyadmin but have been unsuccessful.
It is currently marked in use in phpmyadmin and when I try to repair it it gives me an error.
Here is the text of the Check Table command I got.


CHECK TABLE xf_search_index

xfdb.xf_search_index check warning Table is marked as crashed and last repair failed
xfdb.xf_search_index check warning 1 client is using or hasn't closed the table prope...
xfdb.xf_search_index check warning Size of indexfile is: 2431643648 Should be: 1...
xfdb.xf_search_index check error Can't read indexpage from filepos: -1
xfdb.xf_search_index check Error Incorrect key file for table './xfdb/xf_searc...
xfdb.xf_search_index check error Corrupt

I'm having the host take a look at it also but is there anything I can do on my part to fix this?

Thanks in advance for the help.
 
You can try just emptying (truncating) the table completely. That empties the search index but then you can rebuild it once the table is fixed.

If that doesn't work, you may want to delete the table entirely, if MySQL allows you to. Once you've done that, you can recreate the table with the following query:
SQL:
CREATE TABLE `xf_search_index` (
  `content_type` varchar(25) NOT NULL,
  `content_id` int(10) unsigned NOT NULL,
  `title` varchar(250) NOT NULL DEFAULT '',
  `message` mediumtext NOT NULL,
  `metadata` mediumtext NOT NULL,
  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
  `item_date` int(10) unsigned NOT NULL,
  `discussion_id` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`content_type`,`content_id`),
  KEY `user_id_item_date` (`user_id`,`item_date`),
  FULLTEXT KEY `title_message_metadata` (`title`,`message`,`metadata`),
  FULLTEXT KEY `title_metadata` (`title`,`metadata`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
 
Top Bottom