mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-24 19:08:53 +00:00
[ticket/16659] Resolve issues with fulltext search in mariadb
PHPBB3-16659
This commit is contained in:
parent
d6e1989e1f
commit
4f282db6e2
1 changed files with 13 additions and 0 deletions
|
@ -20,4 +20,17 @@ class phpbb_functional_search_mysql_test extends phpbb_functional_search_base
|
||||||
{
|
{
|
||||||
protected $search_backend = '\phpbb\search\fulltext_mysql';
|
protected $search_backend = '\phpbb\search\fulltext_mysql';
|
||||||
|
|
||||||
|
protected function create_search_index($backend = null)
|
||||||
|
{
|
||||||
|
parent::create_search_index($backend);
|
||||||
|
|
||||||
|
// Try optimizing posts table after creating search index.
|
||||||
|
// Some versions of MariaDB might not return any results in the search
|
||||||
|
// until the table has been optimized or the index deleted and re-created.
|
||||||
|
$db = $this->get_db();
|
||||||
|
$db->sql_return_on_error(true);
|
||||||
|
$sql = 'OPTIMIZE TABLE ' . POSTS_TABLE;
|
||||||
|
$db->sql_query($sql);
|
||||||
|
$db->sql_return_on_error(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue