phpbb\search\fulltext_mysql::delete_index PHP Method

delete_index() public method

Drop fulltext index
public delete_index ( $acp_module, $u_action ) : string | boolean
return string | boolean error string is returned incase of errors otherwise false
    public function delete_index($acp_module, $u_action)
    {
        // Make sure we can actually use MySQL with fulltext indexes
        if ($error = $this->init()) {
            return $error;
        }
        if (empty($this->stats)) {
            $this->get_stats();
        }
        $alter = array();
        if (isset($this->stats['post_subject'])) {
            $alter[] = 'DROP INDEX post_subject';
        }
        if (isset($this->stats['post_content'])) {
            $alter[] = 'DROP INDEX post_content';
        }
        if (sizeof($alter)) {
            $this->db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ' . implode(', ', $alter));
        }
        $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE);
        return false;
    }