mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user