mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00: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:
parent
f7b967dc5a
commit
0228424983
1 changed files with 3 additions and 16 deletions
|
@ -779,7 +779,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
|
||||||
$alter[] = 'ADD FULLTEXT (post_subject)';
|
$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', '>='))
|
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[] = '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)';
|
$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';
|
$alter[] = 'DROP INDEX post_subject';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->stats['post_text']))
|
|
||||||
{
|
|
||||||
$alter[] = 'DROP INDEX post_text';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($this->stats['post_content']))
|
if (isset($this->stats['post_content']))
|
||||||
{
|
{
|
||||||
$alter[] = 'DROP INDEX post_content';
|
$alter[] = 'DROP INDEX post_content';
|
||||||
|
@ -862,7 +853,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
|
||||||
$this->get_stats();
|
$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 ($index_type == 'FULLTEXT')
|
||||||
{
|
{
|
||||||
if ($row['Key_name'] == 'post_text')
|
if ($row['Key_name'] == 'post_subject')
|
||||||
{
|
|
||||||
$this->stats['post_text'] = $row;
|
|
||||||
}
|
|
||||||
else if ($row['Key_name'] == 'post_subject')
|
|
||||||
{
|
{
|
||||||
$this->stats['post_subject'] = $row;
|
$this->stats['post_subject'] = $row;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue