/** * @see RebuildFulltextSearchTable::execute * * @since 2.5 * * @return boolean */ public function run() { if (!$this->searchTableUpdater->isEnabled()) { return $this->reportMessage("\n" . "FullText search indexing is not enabled or supported." . "\n\n"); } $this->searchTableUpdater->flushTable(); $this->reportMessage("\n" . "The index table was purged." . "\n"); $this->reportMessage("\n" . "Rebuilding the text index from (rows finished/expected):" . "\n\n"); foreach ($this->searchTableUpdater->getPropertyTables() as $proptable) { // Only care for Blob/Uri tables if ($proptable->getDiType() !== DataItem::TYPE_BLOB && $proptable->getDiType() !== DataItem::TYPE_URI) { $this->skippedTables[$proptable->getName()] = 'Not a blob or URI table type.'; continue; } $this->doRebuildByPropertyTable($proptable); } $this->reportMessage("\n" . "Table(s) not used for indexing:" . "\n\n", $this->reportVerbose); foreach ($this->skippedTables as $tableName => $reason) { $this->reportMessage("\r" . sprintf("%-36s%s", "- {$tableName}", $reason . "\n"), $this->reportVerbose); } return true; }
public function testFlushTable() { $this->connection->expects($this->once())->method('delete')->with($this->anything(), $this->equalTo('*')); $instance = new SearchTableUpdater($this->connection, $this->searchTable, $this->textSanitizer); $instance->flushTable(); }