• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/pgsql/database.php
  • Класс: CDatabase
  • Вызов: CDatabase::CreateIndex
public function CreateIndex($indexName, $tableName, $columns, $unique = false, $fulltext = false)
{
	foreach ($columns as $i => $columnName)
	{
		$columns[$i] = $this->quote($columnName);
	}

	if ($unique)
	{
		return $this->Query('CREATE UNIQUE INDEX ' . $this->quote($indexName) . ' ON ' . $this->quote($tableName) . '(' . implode(',', $columns) . ')', true);
	}
	elseif ($fulltext)
	{
		return $this->Query('CREATE INDEX ' . $this->quote($indexName) . ' ON ' . $this->quote($tableName) . '(' . implode(',', $columns) . ')', true);
	}
	else
	{
		return $this->Query('CREATE INDEX ' . $this->quote($indexName) . ' ON ' . $this->quote($tableName) . ' USING GIN (to_tsvector('english', ' . implode(',', $columns) . '))', true);
	}
}