/** * Indexes an item from the Index Queue. * * @param Item $item An index queue item to index * @return boolean TRUE if the item was successfully indexed, FALSE otherwise */ protected function indexItem(Item $item) { $itemIndexed = false; $indexer = $this->getIndexerByItem($item->getIndexingConfigurationName()); // Remember original http host value $originalHttpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : null; // Overwrite http host $this->initializeHttpHost($item); $itemIndexed = $indexer->index($item); // update IQ item so that the IQ can determine what's been indexed already if ($itemIndexed) { $item->updateIndexedTime(); } // restore http host if (!is_null($originalHttpHost)) { $_SERVER['HTTP_HOST'] = $originalHttpHost; } else { unset($_SERVER['HTTP_HOST']); } // needed since TYPO3 7.5 GeneralUtility::flushInternalRuntimeCaches(); return $itemIndexed; }
/** * Indexes an item from the Index Queue. * * @param Item $item An index queue item to index * @return boolean TRUE if the item was successfully indexed, FALSE otherwise */ protected function indexItem(Item $item) { $itemIndexed = FALSE; $indexer = $this->getIndexerByItem($item->getIndexingConfigurationName()); // Remember original http host value $originalHttpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : NULL; // Overwrite http host $this->initializeHttpHost($item); $itemIndexed = $indexer->index($item); // update IQ item so that the IQ can determine what's been indexed already if ($itemIndexed) { $item->updateIndexedTime(); } // restore http host if (!is_null($originalHttpHost)) { $_SERVER['HTTP_HOST'] = $originalHttpHost; } else { unset($_SERVER['HTTP_HOST']); } return $itemIndexed; }
/** * Enables logging dependent on the configuration of the item's site * * @param Item $item An item being indexed * @return void */ protected function setLogging(Item $item) { // reset $this->loggingEnabled = FALSE; $solrConfiguration = Util::getSolrConfigurationFromPageId($item->getRootPageUid()); if (!empty($solrConfiguration['logging.']['indexing']) || !empty($solrConfiguration['logging.']['indexing.']['queue']) || !empty($solrConfiguration['logging.']['indexing.']['queue.'][$item->getIndexingConfigurationName()])) { $this->loggingEnabled = TRUE; } }
/** * Enables logging dependent on the configuration of the item's site * * @param Item $item An item being indexed * @return void */ protected function setLogging(Item $item) { $solrConfiguration = Util::getSolrConfigurationFromPageId($item->getRootPageUid()); $this->loggingEnabled = $solrConfiguration->getLoggingIndexingQueueOperationsByConfigurationNameWithFallBack($item->getIndexingConfigurationName()); }