當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ArticleSearchIndex::rebuildIndex方法代碼示例

本文整理匯總了PHP中ArticleSearchIndex::rebuildIndex方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArticleSearchIndex::rebuildIndex方法的具體用法?PHP ArticleSearchIndex::rebuildIndex怎麽用?PHP ArticleSearchIndex::rebuildIndex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ArticleSearchIndex的用法示例。


在下文中一共展示了ArticleSearchIndex::rebuildIndex方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: rebuildSearchIndex

 /**
  * Rebuild the search index.
  * @return boolean
  */
 function rebuildSearchIndex()
 {
     import('classes.search.ArticleSearchIndex');
     $articleSearchIndex = new ArticleSearchIndex();
     $articleSearchIndex->rebuildIndex();
     return true;
 }
開發者ID:laelnasan,項目名稱:UTFPR-ojs,代碼行數:11,代碼來源:Upgrade.inc.php

示例2: execute

 /**
  * Rebuild the search index for all articles in all journals.
  */
 function execute()
 {
     // If we have an argument that this must be a journal path.
     $journal = null;
     if (count($this->argv)) {
         $journalPath = array_shift($this->argv);
         $journalDao =& DAORegistry::getDAO('JournalDAO');
         $journal =& $journalDao->getJournalByPath($journalPath);
         if (!$journal) {
             die(__('search.cli.rebuildIndex.unknownJournal', array('journalPath' => $journalPath)) . "\n");
         }
     }
     // Register a router hook so that we can construct
     // useful URLs to journal content.
     HookRegistry::register('Request::getBaseUrl', array(&$this, 'callbackBaseUrl'));
     // Let the search implementation re-build the index.
     $articleSearchIndex = new ArticleSearchIndex();
     $articleSearchIndex->rebuildIndex(true, $journal);
 }
開發者ID:EreminDm,項目名稱:water-cao,代碼行數:22,代碼來源:rebuildSearchIndex.php

示例3: execute

 /**
  * Rebuild the search index for all articles in all journals.
  */
 function execute()
 {
     // Check whether we have (optional) switches.
     $switches = array();
     while (count($this->argv) && substr($this->argv[0], 0, 1) == '-') {
         $switches[] = array_shift($this->argv);
     }
     // If we have another argument that this must be a journal path.
     $journal = null;
     if (count($this->argv)) {
         $journalPath = array_shift($this->argv);
         $journalDao = DAORegistry::getDAO('JournalDAO');
         $journal = $journalDao->getByPath($journalPath);
         if (!$journal) {
             die(__('search.cli.rebuildIndex.unknownJournal', array('journalPath' => $journalPath)) . "\n");
         }
     }
     // Register a router hook so that we can construct
     // useful URLs to journal content.
     HookRegistry::register('Request::getBaseUrl', array($this, 'callbackBaseUrl'));
     // Let the search implementation re-build the index.
     $articleSearchIndex = new ArticleSearchIndex();
     $articleSearchIndex->rebuildIndex(true, $journal, $switches);
 }
開發者ID:laelnasan,項目名稱:UTFPR-ojs,代碼行數:27,代碼來源:rebuildSearchIndex.php

示例4: execute

 /**
  * Rebuild the search index for all articles in all journals.
  */
 function execute()
 {
     ArticleSearchIndex::rebuildIndex(true);
 }
開發者ID:JovanyJeff,項目名稱:hrp,代碼行數:7,代碼來源:rebuildSearchIndex.php

示例5: rebuildSearchIndex

 /**
  * Rebuild the article search index.
  * Note: Rebuilds index for _all_ journals (non-optimal, but shouldn't be a problem)
  * Based on code from tools/rebuildSearchIndex.php
  */
 function rebuildSearchIndex()
 {
     if ($this->hasOption('verbose')) {
         printf("Rebuilding search index\n");
     }
     ArticleSearchIndex::rebuildIndex();
 }
開發者ID:Jouper,項目名稱:jouper,代碼行數:12,代碼來源:ImportOJS1.inc.php

示例6: rebuildSearchIndex

 /**
  * Rebuild the search index.
  * @return boolean
  */
 function rebuildSearchIndex()
 {
     import('classes.search.ArticleSearchIndex');
     ArticleSearchIndex::rebuildIndex();
     return true;
 }
開發者ID:reconciler,項目名稱:ojs,代碼行數:10,代碼來源:Upgrade.inc.php

示例7: testRebuildIndexViaPluginHook

 /**
  * @covers ArticleSearchIndex
  */
 public function testRebuildIndexViaPluginHook()
 {
     // Diverting to the search plugin hook.
     HookRegistry::register('ArticleSearchIndex::rebuildIndex', array($this, 'callbackRebuildIndex'));
     // Test log output.
     $this->expectOutputString("Some log message from the plug-in.");
     // Simulate rebuilding the index via hook.
     $articleSearchIndex = new ArticleSearchIndex();
     $articleSearchIndex->rebuildIndex(true);
     // With log
     $articleSearchIndex->rebuildIndex(false);
     // Without log (that's why we expect the log message to appear only once).
     // Remove the test hook.
     HookRegistry::clear('ArticleSearchIndex::rebuildIndex');
 }
開發者ID:mosvits,項目名稱:ojs,代碼行數:18,代碼來源:ArticleSearchIndexTest.php


注:本文中的ArticleSearchIndex::rebuildIndex方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。