aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/search/fulltext_postgres.php
diff options
context:
space:
mode:
authorDhruv <dhruv.goel92@gmail.com>2013-08-26 15:09:01 +0530
committerDhruv <dhruv.goel92@gmail.com>2014-03-12 11:02:00 +0530
commit101ceed80c4ba3b24aaf92d1e72529c086237888 (patch)
tree21c136dd7d1d4fd53b6f13a555e4414d976d89a9 /phpBB/phpbb/search/fulltext_postgres.php
parent87688687e4eaa274ccfec10c43b6b91d050d05e5 (diff)
downloadforums-101ceed80c4ba3b24aaf92d1e72529c086237888.tar
forums-101ceed80c4ba3b24aaf92d1e72529c086237888.tar.gz
forums-101ceed80c4ba3b24aaf92d1e72529c086237888.tar.bz2
forums-101ceed80c4ba3b24aaf92d1e72529c086237888.tar.xz
forums-101ceed80c4ba3b24aaf92d1e72529c086237888.zip
[ticket/11040] Remove postgres extra indexes
Remove post_text index as post_content index is sufficient to search post text. PHPBB3-11040
Diffstat (limited to 'phpBB/phpbb/search/fulltext_postgres.php')
-rw-r--r--phpBB/phpbb/search/fulltext_postgres.php18
1 files changed, 2 insertions, 16 deletions
diff --git a/phpBB/phpbb/search/fulltext_postgres.php b/phpBB/phpbb/search/fulltext_postgres.php
index 32519b1f14..cb50ce69f0 100644
--- a/phpBB/phpbb/search/fulltext_postgres.php
+++ b/phpBB/phpbb/search/fulltext_postgres.php
@@ -791,11 +791,6 @@ class fulltext_postgres extends \phpbb\search\base
$this->db->sql_query("CREATE INDEX " . POSTS_TABLE . "_" . $this->config['fulltext_postgres_ts_name'] . "_post_subject ON " . POSTS_TABLE . " USING gin (to_tsvector ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', post_subject))");
}
- if (!isset($this->stats['post_text']))
- {
- $this->db->sql_query("CREATE INDEX " . POSTS_TABLE . "_" . $this->config['fulltext_postgres_ts_name'] . "_post_text ON " . POSTS_TABLE . " USING gin (to_tsvector ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', post_text))");
- }
-
if (!isset($this->stats['post_content']))
{
$this->db->sql_query("CREATE INDEX " . POSTS_TABLE . "_" . $this->config['fulltext_postgres_ts_name'] . "_post_content ON " . POSTS_TABLE . " USING gin (to_tsvector ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', post_subject || ' ' || post_text))");
@@ -829,11 +824,6 @@ class fulltext_postgres extends \phpbb\search\base
$this->db->sql_query('DROP INDEX ' . $this->stats['post_subject']['relname']);
}
- if (isset($this->stats['post_text']))
- {
- $this->db->sql_query('DROP INDEX ' . $this->stats['post_text']['relname']);
- }
-
if (isset($this->stats['post_content']))
{
$this->db->sql_query('DROP INDEX ' . $this->stats['post_content']['relname']);
@@ -854,7 +844,7 @@ class fulltext_postgres extends \phpbb\search\base
$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;
}
/**
@@ -896,11 +886,7 @@ class fulltext_postgres extends \phpbb\search\base
// deal with older PostgreSQL versions which didn't use Index_type
if (strpos($row['indexdef'], 'to_tsvector') !== false)
{
- if ($row['relname'] == POSTS_TABLE . '_' . $this->config['fulltext_postgres_ts_name'] . '_post_text' || $row['relname'] == POSTS_TABLE . '_post_text')
- {
- $this->stats['post_text'] = $row;
- }
- else if ($row['relname'] == POSTS_TABLE . '_' . $this->config['fulltext_postgres_ts_name'] . '_post_subject' || $row['relname'] == POSTS_TABLE . '_post_subject')
+ if ($row['relname'] == POSTS_TABLE . '_' . $this->config['fulltext_postgres_ts_name'] . '_post_subject' || $row['relname'] == POSTS_TABLE . '_post_subject')
{
$this->stats['post_subject'] = $row;
}