当前位置: 首页>>代码示例>>PHP>>正文


PHP Site::getSolrConfiguration方法代码示例

本文整理汇总了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;
 }
开发者ID:hnadler,项目名称:ext-solr,代码行数:15,代码来源:IndexingConfigurationSelectorField.php

示例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);
     }
 }
开发者ID:neufeind,项目名称:ext-solr,代码行数:13,代码来源:AbstractInitializer.php

示例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;
 }
开发者ID:sitegeist,项目名称:ext-solr,代码行数:28,代码来源:ReIndexTask.php

示例4: __construct

 /**
  * @param Site $site
  * @internal param \ApacheSolrForTypo3\Solr\Site $configuration
  */
 public function __construct(Site $site)
 {
     $this->configuration = $site->getSolrConfiguration();
     $this->site = $site;
 }
开发者ID:hnadler,项目名称:ext-solr,代码行数:9,代码来源:IndexService.php

示例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;
 }
开发者ID:nxpthx,项目名称:ext-solr,代码行数:36,代码来源:Queue.php


注:本文中的ApacheSolrForTypo3\Solr\Site::getSolrConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。