mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 13:28:55 +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
|
@ -631,24 +631,24 @@ class fulltext_sphinx implements search_backend_interface
|
||||||
*/
|
*/
|
||||||
public function create_index(int &$post_counter = 0): ?array
|
public function create_index(int &$post_counter = 0): ?array
|
||||||
{
|
{
|
||||||
$table_data = array(
|
if (!$this->index_created())
|
||||||
'COLUMNS' => array(
|
{
|
||||||
'counter_id' => array('UINT', 0),
|
$table_data = array(
|
||||||
'max_doc_id' => array('UINT', 0),
|
'COLUMNS' => array(
|
||||||
),
|
'counter_id' => array('UINT', 0),
|
||||||
'PRIMARY_KEY' => 'counter_id',
|
'max_doc_id' => array('UINT', 0),
|
||||||
);
|
),
|
||||||
$this->db_tools->sql_create_table(SPHINX_TABLE, $table_data);
|
'PRIMARY_KEY' => 'counter_id',
|
||||||
|
);
|
||||||
|
$this->db_tools->sql_create_table(SPHINX_TABLE, $table_data);
|
||||||
|
|
||||||
$sql = 'TRUNCATE TABLE ' . SPHINX_TABLE;
|
$data = array(
|
||||||
$this->db->sql_query($sql);
|
'counter_id' => '1',
|
||||||
|
'max_doc_id' => '0',
|
||||||
$data = array(
|
);
|
||||||
'counter_id' => '1',
|
$sql = 'INSERT INTO ' . SPHINX_TABLE . ' ' . $this->db->sql_build_array('INSERT', $data);
|
||||||
'max_doc_id' => '0',
|
$this->db->sql_query($sql);
|
||||||
);
|
}
|
||||||
$sql = 'INSERT INTO ' . SPHINX_TABLE . ' ' . $this->db->sql_build_array('INSERT', $data);
|
|
||||||
$this->db->sql_query($sql);
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -658,7 +658,10 @@ class fulltext_sphinx implements search_backend_interface
|
||||||
*/
|
*/
|
||||||
public function delete_index(int &$post_counter = null): ?array
|
public function delete_index(int &$post_counter = null): ?array
|
||||||
{
|
{
|
||||||
$this->db_tools->sql_table_drop(SPHINX_TABLE);
|
if ($this->index_created())
|
||||||
|
{
|
||||||
|
$this->db_tools->sql_table_drop(SPHINX_TABLE);
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue