phpBB

Code Changes

File: phpbb/search/fulltext_postgres.php

  Unmodified   Added   Modified   Removed
Line 972Line 972

if (!isset($this->stats['post_content']))
{


if (!isset($this->stats['post_content']))
{

			$sql_queries[] = "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_text || ' ' || post_subject))";






			$sql_queries[] = "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_text))";
}

if (!isset($this->stats['post_subject_content']))
{
$sql_queries[] = "CREATE INDEX " . POSTS_TABLE . "_" . $this->config['fulltext_postgres_ts_name'] . "_post_subject_content ON " . POSTS_TABLE . " USING gin (to_tsvector ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', post_subject || ' ' || post_text))";

		}

$stats = $this->stats;

		}

$stats = $this->stats;

Line 1029Line 1034
		if (isset($this->stats['post_content']))
{
$sql_queries[] = 'DROP INDEX ' . $this->stats['post_content']['relname'];

		if (isset($this->stats['post_content']))
{
$sql_queries[] = 'DROP INDEX ' . $this->stats['post_content']['relname'];

 
		}

if (isset($this->stats['post_subject_content']))
{
$sql_queries[] = 'DROP INDEX ' . $this->stats['post_subject_content']['relname'];

		}

$stats = $this->stats;

		}

$stats = $this->stats;

Line 1116Line 1126
				else if ($row['relname'] == POSTS_TABLE . '_' . $this->config['fulltext_postgres_ts_name'] . '_post_content' || $row['relname'] == POSTS_TABLE . '_post_content')
{
$this->stats['post_content'] = $row;

				else if ($row['relname'] == POSTS_TABLE . '_' . $this->config['fulltext_postgres_ts_name'] . '_post_content' || $row['relname'] == POSTS_TABLE . '_post_content')
{
$this->stats['post_content'] = $row;

 
				}
else if ($row['relname'] == POSTS_TABLE . '_' . $this->config['fulltext_postgres_ts_name'] . '_post_subject_content' || $row['relname'] == POSTS_TABLE . '_post_subject_content')
{
$this->stats['post_subject_content'] = $row;

				}
}
}

				}
}
}