/** * Triggers Index Queue updates for other pages showing content from the * page currently being updated. * * @param integer $pageId UID of the page currently being updated */ protected function updateCanonicalPages($pageId) { $canonicalPages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid', 'pages', 'content_from_pid = ' . $pageId . BackendUtility::deleteClause('pages')); foreach ($canonicalPages as $page) { $this->indexQueue->updateItem('pages', $page['uid']); } }
/** * @test */ public function canNotAddUnAllowedPageType() { $this->importDataSetFromFixture('can_not_add_unallowed_pagetype.xml'); $this->assertEmptyQueue(); // record does not exist in fixture $this->indexQueue->updateItem('pages', 22); // queue should still be empty $this->assertEmptyQueue(); }
/** * @param string $table * @param int $uid * @return \Apache_Solr_Response */ protected function addToQueueAndIndexRecord($table, $uid) { // write an index queue item $this->indexQueue->updateItem($table, $uid); // run the indexer $items = $this->indexQueue->getItems($table, $uid); foreach ($items as $item) { $result = $this->indexer->index($item); } return $result; }
/** * @test */ public function solrIsEmptyAfterCleanup() { $this->importDataSetFromFixture('can_reindex_task_fill_queue.xml'); // fill the solr $site = Site::getFirstAvailableSite(); $this->indexQueue->updateItem('pages', 1); $items = $this->indexQueue->getItems('pages', 1); /** @var $indexer \ApacheSolrForTypo3\Solr\IndexQueue\Indexer */ $indexer = GeneralUtility::makeInstance('ApacheSolrForTypo3\\Solr\\IndexQueue\\Indexer'); $indexer->index($items[0]); sleep(2); $this->assertSolrContainsDocumentCount(1); $this->task->setSite($site); $this->task->setIndexingConfigurationsToReIndex(array('pages')); $this->task->execute(); sleep(2); // after the task was running the solr server should be empty $this->assertSolrIsEmpty(); // if not we cleanup now $this->cleanUpSolrServerAndAssertEmpty(); }
/** * @param string $table * @param int $uid * @return \Apache_Solr_Response */ protected function addToIndexQueue($table, $uid) { // write an index queue item $this->indexQueue->updateItem($table, $uid, null, time()); }