本文整理汇总了PHP中ApacheSolrForTypo3\Solr\Site::getSolrConfiguration方法的典型用法代码示例。如果您正苦于以下问题:PHP Site::getSolrConfiguration方法的具体用法?PHP Site::getSolrConfiguration怎么用?PHP Site::getSolrConfiguration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApacheSolrForTypo3\Solr\Site
的用法示例。
在下文中一共展示了Site::getSolrConfiguration方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIndexQueueConfigurationTableMap
/**
* Builds a map of indexing configuration names to tables to to index.
*
* @return array Indexing configuration to database table map
*/
protected function getIndexQueueConfigurationTableMap()
{
$indexingTableMap = array();
$solrConfiguration = $this->site->getSolrConfiguration();
$configurationNames = $solrConfiguration->getEnabledIndexQueueConfigurationNames();
foreach ($configurationNames as $configurationName) {
$indexingTableMap[$configurationName] = $solrConfiguration->getIndexQueueTableNameOrFallbackToConfigurationName($configurationName);
}
return $indexingTableMap;
}
示例2: logInitialization
protected function logInitialization($initializationQuery)
{
$solrConfiguration = $this->site->getSolrConfiguration();
$logSeverity = -1;
$logData = array('site' => $this->site->getLabel(), 'indexing configuration name' => $this->indexingConfigurationName, 'type' => $this->type, 'query' => $initializationQuery, 'rows' => $GLOBALS['TYPO3_DB']->sql_affected_rows());
if ($GLOBALS['TYPO3_DB']->sql_errno()) {
$logSeverity = 3;
$logData['error'] = $GLOBALS['TYPO3_DB']->sql_errno() . ': ' . $GLOBALS['TYPO3_DB']->sql_error();
}
if ($solrConfiguration['logging.']['indexing.']['indexQueueInitialization']) {
GeneralUtility::devLog('Index Queue initialized for indexing configuration ' . $this->indexingConfigurationName, 'solr', $logSeverity, $logData);
}
}
示例3: cleanUpIndex
/**
* Removes documents of the selected types from the index.
*
* @return bool TRUE if clean up was successful, FALSE on error
*/
protected function cleanUpIndex()
{
$cleanUpResult = true;
$solrConfiguration = $this->site->getSolrConfiguration();
$solrServers = GeneralUtility::makeInstance('ApacheSolrForTypo3\\Solr\\ConnectionManager')->getConnectionsBySite($this->site);
$typesToCleanUp = array();
foreach ($this->indexingConfigurationsToReIndex as $indexingConfigurationName) {
$type = $solrConfiguration->getIndexQueueTableNameOrFallbackToConfigurationName($indexingConfigurationName);
$typesToCleanUp[] = $type;
}
foreach ($solrServers as $solrServer) {
// make sure not-yet committed documents are removed, too
$solrServer->commit();
$deleteQuery = 'type:(' . implode(' OR ', $typesToCleanUp) . ')' . ' AND siteHash:' . $this->site->getSiteHash();
$solrServer->deleteByQuery($deleteQuery);
$response = $solrServer->commit(false, false, false);
if ($response->getHttpStatus() != 200) {
$cleanUpResult = false;
break;
}
}
return $cleanUpResult;
}
示例4: __construct
/**
* @param Site $site
* @internal param \ApacheSolrForTypo3\Solr\Site $configuration
*/
public function __construct(Site $site)
{
$this->configuration = $site->getSolrConfiguration();
$this->site = $site;
}
示例5: initialize
/**
* Truncate and rebuild the tx_solr_indexqueue_item table. This is the most
* complete way to force reindexing, or to build the Index Queue for the
* first time. The Index Queue initialization is site-specific.
*
* @param Site $site The site to initialize
* @param string $indexingConfigurationName Name of a specific
* indexing configuration
* @return array An array of booleans, each representing whether the
* initialization for an indexing configuration was successful
*/
public function initialize(Site $site, $indexingConfigurationName = '')
{
$indexingConfigurations = array();
$initializationStatus = array();
if (empty($indexingConfigurationName)) {
$solrConfiguration = $site->getSolrConfiguration();
$indexingConfigurations = $this->getTableIndexingConfigurations($solrConfiguration);
} else {
$indexingConfigurations[] = $indexingConfigurationName;
}
foreach ($indexingConfigurations as $indexingConfigurationName) {
$initializationStatus[$indexingConfigurationName] = $this->initializeIndexingConfiguration($site, $indexingConfigurationName);
}
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['postProcessIndexQueueInitialization'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['postProcessIndexQueueInitialization'] as $classReference) {
$indexQueueInitializationPostProcessor = GeneralUtility::getUserObj($classReference);
if ($indexQueueInitializationPostProcessor instanceof InitializationPostProcessor) {
$indexQueueInitializationPostProcessor->postProcessIndexQueueInitialization($site, $indexingConfigurations, $initializationStatus);
} else {
throw new \UnexpectedValueException(get_class($indexQueueInitializationPostProcessor) . ' must implement interface ApacheSolrForTypo3\\Solr\\IndexQueue\\InitializationPostProcessor', 1345815561);
}
}
}
return $initializationStatus;
}