[ticket/11621] Remove mysql extra indexes

Remove post_text index as post_content index is sufficient to search post
text.

PHPBB3-11621
This commit is contained in:
Dhruv 2013-08-26 15:16:56 +05:30
parent f7b967dc5a
commit 0228424983

View file

@ -779,7 +779,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
$alter[] = 'ADD FULLTEXT (post_subject)';
}
if (!isset($this->stats['post_text']))
if (!isset($this->stats['post_content']))
{
if ($this->db->sql_layer == 'mysqli' || version_compare($this->db->sql_server_info(true), '4.1.3', '>='))
{
@ -789,11 +789,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
{
$alter[] = 'MODIFY post_text mediumtext NOT NULL';
}
$alter[] = 'ADD FULLTEXT (post_text)';
}
if (!isset($this->stats['post_content']))
{
$alter[] = 'ADD FULLTEXT post_content (post_subject, post_text)';
}
@ -832,11 +828,6 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
$alter[] = 'DROP INDEX post_subject';
}
if (isset($this->stats['post_text']))
{
$alter[] = 'DROP INDEX post_text';
}
if (isset($this->stats['post_content']))
{
$alter[] = 'DROP INDEX post_content';
@ -862,7 +853,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
$this->get_stats();
}
return (isset($this->stats['post_text']) && isset($this->stats['post_subject']) && isset($this->stats['post_content'])) ? true : false;
return (isset($this->stats['post_subject']) && isset($this->stats['post_content'])) ? true : false;
}
/**
@ -902,11 +893,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
if ($index_type == 'FULLTEXT')
{
if ($row['Key_name'] == 'post_text')
{
$this->stats['post_text'] = $row;
}
else if ($row['Key_name'] == 'post_subject')
if ($row['Key_name'] == 'post_subject')
{
$this->stats['post_subject'] = $row;
}