mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 13:58:54 +00:00
[ticket/12683] Undo changes in fulltext_sphinx.php
PHPBB3-12683
This commit is contained in:
parent
e6af4c4def
commit
1c191868de
1 changed files with 21 additions and 18 deletions
|
@ -630,6 +630,8 @@ class fulltext_sphinx implements search_backend_interface
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function create_index(int &$post_counter = 0): ?array
|
public function create_index(int &$post_counter = 0): ?array
|
||||||
|
{
|
||||||
|
if (!$this->index_created())
|
||||||
{
|
{
|
||||||
$table_data = array(
|
$table_data = array(
|
||||||
'COLUMNS' => array(
|
'COLUMNS' => array(
|
||||||
|
@ -640,15 +642,13 @@ class fulltext_sphinx implements search_backend_interface
|
||||||
);
|
);
|
||||||
$this->db_tools->sql_create_table(SPHINX_TABLE, $table_data);
|
$this->db_tools->sql_create_table(SPHINX_TABLE, $table_data);
|
||||||
|
|
||||||
$sql = 'TRUNCATE TABLE ' . SPHINX_TABLE;
|
|
||||||
$this->db->sql_query($sql);
|
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'counter_id' => '1',
|
'counter_id' => '1',
|
||||||
'max_doc_id' => '0',
|
'max_doc_id' => '0',
|
||||||
);
|
);
|
||||||
$sql = 'INSERT INTO ' . SPHINX_TABLE . ' ' . $this->db->sql_build_array('INSERT', $data);
|
$sql = 'INSERT INTO ' . SPHINX_TABLE . ' ' . $this->db->sql_build_array('INSERT', $data);
|
||||||
$this->db->sql_query($sql);
|
$this->db->sql_query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -657,8 +657,11 @@ class fulltext_sphinx implements search_backend_interface
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function delete_index(int &$post_counter = null): ?array
|
public function delete_index(int &$post_counter = null): ?array
|
||||||
|
{
|
||||||
|
if ($this->index_created())
|
||||||
{
|
{
|
||||||
$this->db_tools->sql_table_drop(SPHINX_TABLE);
|
$this->db_tools->sql_table_drop(SPHINX_TABLE);
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue