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


PHP Util::getSolrConfigurationFromPageId方法代码示例

本文整理汇总了PHP中ApacheSolrForTypo3\Solr\Util::getSolrConfigurationFromPageId方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::getSolrConfigurationFromPageId方法的具体用法?PHP Util::getSolrConfigurationFromPageId怎么用?PHP Util::getSolrConfigurationFromPageId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ApacheSolrForTypo3\Solr\Util的用法示例。


在下文中一共展示了Util::getSolrConfigurationFromPageId方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 /**
  * Works through the indexing queue and indexes the queued items into Solr.
  *
  * @return boolean Returns TRUE on success, FALSE if no items were indexed or none were found.
  */
 public function execute()
 {
     $executionSucceeded = false;
     $this->configuration = Util::getSolrConfigurationFromPageId($this->site->getRootPageId());
     $this->indexItems();
     $executionSucceeded = true;
     return $executionSucceeded;
 }
开发者ID:kalypso63,项目名称:ext-solr,代码行数:13,代码来源:IndexQueueWorkerTask.php

示例2: execute

 /**
  * Works through the indexing queue and indexes the queued items into Solr.
  *
  * @return boolean Returns TRUE on success, FALSE if no items were indexed or none were found.
  */
 public function execute()
 {
     $executionSucceeded = FALSE;
     $this->configuration = Util::getSolrConfigurationFromPageId($this->site->getRootPageId());
     $this->indexItems();
     $this->cleanIndex();
     $executionSucceeded = TRUE;
     return $executionSucceeded;
 }
开发者ID:nxpthx,项目名称:ext-solr,代码行数:14,代码来源:IndexQueueWorkerTask.php

示例3: getMonitoredTables

 /**
  * Gets an array of tables configured for indexing by the Index Queue. The
  * record monitor must watch these tables for manipulation.
  *
  * @param integer $pageId The page id for which we need to retrieve the configuration for
  * @return array Array of table names to be watched by the record monitor.
  */
 protected function getMonitoredTables($pageId)
 {
     $monitoredTables = array();
     // FIXME!! $pageId might be outside of a site root and thus might not know about solr configuration
     // -> leads to record not being queued for reindexing
     $solrConfiguration = Util::getSolrConfigurationFromPageId($pageId);
     $indexingConfigurations = $solrConfiguration->getEnabledIndexQueueConfigurationNames();
     foreach ($indexingConfigurations as $indexingConfigurationName) {
         $monitoredTable = $this->solrConfiguration->getIndexQueueTableNameOrFallbackToConfigurationName($indexingConfigurationName);
         $monitoredTables[] = $monitoredTable;
         if ($monitoredTable == 'pages') {
             // when monitoring pages, also monitor creation of translations
             $monitoredTables[] = 'pages_language_overlay';
         }
     }
     return array_unique($monitoredTables);
 }
开发者ID:hnadler,项目名称:ext-solr,代码行数:24,代码来源:RecordMonitor.php

示例4: getMonitoredTables

 /**
  * Gets an array of tables configured for indexing by the Index Queue. The
  * record monitor must watch these tables for manipulation.
  *
  * @param integer $pageId The page id for which we need to retrieve the configuration for
  * @return array Array of table names to be watched by the record monitor.
  */
 protected function getMonitoredTables($pageId)
 {
     $monitoredTables = array();
     // FIXME!! $pageId might be outside of a site root and thus might not know about solr configuration
     // -> leads to record not being queued for reindexing
     $solrConfiguration = Util::getSolrConfigurationFromPageId($pageId);
     $indexingConfigurations = GeneralUtility::makeInstance('ApacheSolrForTypo3\\Solr\\IndexQueue\\Queue')->getTableIndexingConfigurations($solrConfiguration);
     foreach ($indexingConfigurations as $indexingConfigurationName) {
         $monitoredTable = $indexingConfigurationName;
         if (!empty($solrConfiguration['index.']['queue.'][$indexingConfigurationName . '.']['table'])) {
             // table has been set explicitly. Allows to index the same table with different configurations
             $monitoredTable = $solrConfiguration['index.']['queue.'][$indexingConfigurationName . '.']['table'];
         }
         $monitoredTables[] = $monitoredTable;
         if ($monitoredTable == 'pages') {
             // when monitoring pages, also monitor creation of translations
             $monitoredTables[] = 'pages_language_overlay';
         }
     }
     return array_unique($monitoredTables);
 }
开发者ID:kalypso63,项目名称:ext-solr,代码行数:28,代码来源:RecordMonitor.php

示例5: getSolrConfiguration

 /**
  * Gets the site's Solr TypoScript configuration (plugin.tx_solr.*)
  *
  * @return array The Solr TypoScript configuration
  */
 public function getSolrConfiguration()
 {
     return Util::getSolrConfigurationFromPageId($this->rootPage['uid']);
 }
开发者ID:kalypso63,项目名称:ext-solr,代码行数:9,代码来源:Site.php

示例6: setLogging

 /**
  * 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;
     }
 }
开发者ID:nxpthx,项目名称:ext-solr,代码行数:15,代码来源:Indexer.php

示例7: addItem

 /**
  * Adds an item to the index queue.
  *
  * Not meant for public use.
  *
  * @param string $itemType The item's type, usually a table name.
  * @param string $itemUid The item's uid, usually an integer uid, could be a
  *      different value for non-database-record types.
  * @param string $indexingConfiguration The item's indexing configuration to use.
  *      Optional, overwrites existing / determined configuration.
  * @return void
  */
 private function addItem($itemType, $itemUid, $indexingConfiguration)
 {
     $additionalRecordFields = '';
     if ($itemType == 'pages') {
         $additionalRecordFields = ', doktype, uid';
     }
     $record = BackendUtility::getRecord($itemType, $itemUid, 'pid' . $additionalRecordFields);
     if (empty($record) || $itemType == 'pages' && !Util::isAllowedPageType($record)) {
         return;
     }
     if ($itemType == 'pages') {
         $rootPageId = Util::getRootPageId($itemUid);
     } else {
         $rootPageId = Util::getRootPageId($record['pid']);
     }
     if (Util::isRootPage($rootPageId)) {
         $item = array('root' => $rootPageId, 'item_type' => $itemType, 'item_uid' => $itemUid, 'changed' => $this->getItemChangedTime($itemType, $itemUid));
         if (!empty($indexingConfiguration)) {
             $indexingConfigurationList = array($indexingConfiguration);
         } else {
             $indexingConfigurationList = $this->getIndexingConfigurationsByItem($itemType, $itemUid, $rootPageId);
         }
         $solrConfiguration = Util::getSolrConfigurationFromPageId($rootPageId);
         // make a backup of the current item
         $baseItem = $item;
         foreach ($indexingConfigurationList as $indexingConfigurationCurrent) {
             $item = $baseItem;
             $item['indexing_configuration'] = $indexingConfigurationCurrent;
             $addItemToQueue = TRUE;
             // Ensure additionalWhereClause is applied.
             if (!empty($solrConfiguration['index.']['queue.'][$item['indexing_configuration'] . '.']['additionalWhereClause'])) {
                 $indexingConfigurationCheckRecord = BackendUtility::getRecord($itemType, $itemUid, 'pid' . $additionalRecordFields, ' AND ' . $solrConfiguration['index.']['queue.'][$item['indexing_configuration'] . '.']['additionalWhereClause']);
                 if (empty($indexingConfigurationCheckRecord)) {
                     // item does not match the indexing configuration's additionalWhereClause
                     $addItemToQueue = FALSE;
                 }
             }
             if ($addItemToQueue) {
                 $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_solr_indexqueue_item', $item);
             }
         }
     }
 }
开发者ID:nxpthx,项目名称:ext-solr,代码行数:55,代码来源:Queue.php

示例8: 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 = Util::getSolrConfigurationFromPageId($this->site->getRootPageId());
     foreach ($solrConfiguration['index.']['queue.'] as $name => $configuration) {
         if (is_array($configuration)) {
             $name = substr($name, 0, -1);
             if ($solrConfiguration['index.']['queue.'][$name]) {
                 $table = $name;
                 if ($solrConfiguration['index.']['queue.'][$name . '.']['table']) {
                     $table = $solrConfiguration['index.']['queue.'][$name . '.']['table'];
                 }
                 $indexingTableMap[$name] = $table;
             }
         }
     }
     return $indexingTableMap;
 }
开发者ID:Gregor-Agnes,项目名称:ext-solr,代码行数:23,代码来源:IndexingConfigurationSelectorField.php

示例9: setLogging

 /**
  * 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());
 }
开发者ID:sitegeist,项目名称:ext-solr,代码行数:11,代码来源:Indexer.php


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