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


PHP SearchEngine::getSearchTypes方法代码示例

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


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

示例1: doUpdate

 /**
  * Perform actual update for the entry
  */
 public function doUpdate()
 {
     global $wgDisableSearchUpdate;
     if ($wgDisableSearchUpdate || !$this->id) {
         return;
     }
     wfProfileIn(__METHOD__);
     $page = WikiPage::newFromId($this->id, WikiPage::READ_LATEST);
     $indexTitle = Title::indexTitle($this->title->getNamespace(), $this->title->getText());
     foreach (SearchEngine::getSearchTypes() as $type) {
         $search = SearchEngine::create($type);
         if (!$search->supports('search-update')) {
             continue;
         }
         $normalTitle = $search->normalizeText($indexTitle);
         if ($page === null) {
             $search->delete($this->id, $normalTitle);
             continue;
         } elseif ($this->content === false) {
             $search->updateTitle($this->id, $normalTitle);
             continue;
         }
         $text = $search->getTextFromContent($this->title, $this->content);
         if (!$search->textAlreadyUpdatedForIndex()) {
             $text = self::updateText($text);
         }
         # Perform the actual update
         $search->update($this->id, $normalTitle, $search->normalizeText($text));
     }
     wfProfileOut(__METHOD__);
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:34,代码来源:SearchUpdate.php

示例2: doUpdate

 /**
  * Perform actual update for the entry
  */
 public function doUpdate()
 {
     global $wgDisableSearchUpdate;
     if ($wgDisableSearchUpdate || !$this->id) {
         return;
     }
     foreach (SearchEngine::getSearchTypes() as $type) {
         $search = SearchEngine::create($type);
         if (!$search->supports('search-update')) {
             continue;
         }
         $normalTitle = $this->getNormalizedTitle($search);
         if ($this->getLatestPage() === null) {
             $search->delete($this->id, $normalTitle);
             continue;
         } elseif ($this->content === false) {
             $search->updateTitle($this->id, $normalTitle);
             continue;
         }
         $text = $search->getTextFromContent($this->title, $this->content);
         if (!$search->textAlreadyUpdatedForIndex()) {
             $text = self::updateText($text);
         }
         # Perform the actual update
         $search->update($this->id, $normalTitle, $search->normalizeText($text));
     }
 }
开发者ID:Acidburn0zzz,项目名称:mediawiki,代码行数:30,代码来源:SearchUpdate.php

示例3: getAllowedParams

 public function getAllowedParams()
 {
     $params = array('search' => array(ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_REQUIRED => true), 'namespace' => array(ApiBase::PARAM_DFLT => NS_MAIN, ApiBase::PARAM_TYPE => 'namespace', ApiBase::PARAM_ISMULTI => true), 'what' => array(ApiBase::PARAM_DFLT => null, ApiBase::PARAM_TYPE => array('title', 'text', 'nearmatch')), 'info' => array(ApiBase::PARAM_DFLT => 'totalhits|suggestion|rewrittenquery', ApiBase::PARAM_TYPE => array('totalhits', 'suggestion', 'rewrittenquery'), ApiBase::PARAM_ISMULTI => true), 'prop' => array(ApiBase::PARAM_DFLT => 'size|wordcount|timestamp|snippet', ApiBase::PARAM_TYPE => array('size', 'wordcount', 'timestamp', 'snippet', 'titlesnippet', 'redirecttitle', 'redirectsnippet', 'sectiontitle', 'sectionsnippet', 'isfilematch', 'categorysnippet', 'score', 'hasrelated'), ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_HELP_MSG_PER_VALUE => array()), 'offset' => array(ApiBase::PARAM_DFLT => 0, ApiBase::PARAM_HELP_MSG => 'api-help-param-continue'), 'limit' => array(ApiBase::PARAM_DFLT => 10, ApiBase::PARAM_TYPE => 'limit', ApiBase::PARAM_MIN => 1, ApiBase::PARAM_MAX => ApiBase::LIMIT_SML1, ApiBase::PARAM_MAX2 => ApiBase::LIMIT_SML2), 'interwiki' => false, 'enablerewrites' => false);
     $alternatives = SearchEngine::getSearchTypes();
     if (count($alternatives) > 1) {
         if ($alternatives[0] === null) {
             $alternatives[0] = self::BACKEND_NULL_PARAM;
         }
         $params['backend'] = array(ApiBase::PARAM_DFLT => $this->getConfig()->get('SearchType'), ApiBase::PARAM_TYPE => $alternatives);
     }
     return $params;
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:12,代码来源:ApiQuerySearch.php

示例4: getParamDescription

 public function getParamDescription()
 {
     $descriptions = array('search' => 'Search for all page titles (or content) that has this value', 'namespace' => 'The namespace(s) to enumerate', 'what' => 'Search inside the text or titles', 'info' => 'What metadata to return', 'prop' => array('What properties to return', ' size             - Adds the size of the page in bytes', ' wordcount        - Adds the word count of the page', ' timestamp        - Adds the timestamp of when the page was last edited', ' score            - DEPRECATED and IGNORED', ' snippet          - Adds a parsed snippet of the page', ' titlesnippet     - Adds a parsed snippet of the page title', ' redirectsnippet  - Adds a parsed snippet of the redirect title', ' redirecttitle    - Adds the title of the matching redirect', ' sectionsnippet   - Adds a parsed snippet of the matching section title', ' sectiontitle     - Adds the title of the matching section', ' hasrelated       - DEPRECATED and IGNORED'), 'offset' => 'Use this value to continue paging (return by query)', 'limit' => 'How many total pages to return', 'interwiki' => 'Include interwiki results in the search, if available');
     if (count(SearchEngine::getSearchTypes()) > 1) {
         $descriptions['backend'] = 'Which search backend to use, if not the default';
     }
     return $descriptions;
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:8,代码来源:ApiQuerySearch.php

示例5: readData

 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     if (!count($_POST)) {
         // set current date
         $this->untilDay = intval(DateUtil::formatDate('%d', null, false, true));
         $this->untilMonth = intval(DateUtil::formatDate('%m', null, false, true));
         $this->untilYear = intval(DateUtil::formatDate('%Y', null, false, true));
     }
     $this->availableTypes = SearchEngine::getSearchTypes();
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:14,代码来源:SearchForm.class.php


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