1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-02 23:07:39 +02:00

[ticket/12683] Undo changes in fulltext_sphinx.php

PHPBB3-12683
This commit is contained in:
Ruben Calvo
2022-03-17 02:59:34 +01:00
parent e6af4c4def
commit 1c191868de

View File

@@ -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;
} }