本文整理汇总了PHP中Indexer::getIndex方法的典型用法代码示例。如果您正苦于以下问题:PHP Indexer::getIndex方法的具体用法?PHP Indexer::getIndex怎么用?PHP Indexer::getIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Indexer
的用法示例。
在下文中一共展示了Indexer::getIndex方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Indexer
<ul class='custom_list'>
<li><b>" . $lastregisteredprofs . "</b> $langTeachers</li>
<li><b>" . $lastregisteredstuds . "</b> $langStudents </li>
</ul>
</div>
</div>
</div>
</div>";
// INDEX RELATED
if (get_config('enable_indexing')) {
require_once 'modules/search/indexer.class.php';
$idx = new Indexer();
$numDocs = $idx->getIndex()->numDocs();
$isOpt = (!$idx->getIndex()->hasDeletions()) ? $m['yes'] : $m['no'];
$tool_content .= "
<div class='panel panel-default'>
<div class='panel-heading'>
<h3 class='panel-title'>$langIndexInfo</h3>
</div>
<div class='panel-body'>
<div class='row margin-bottom-thin'>
<div class='col-sm-3'>
<strong>$langIndexNumDocs:</strong>
</div>
<div class='col-sm-9'>
$numDocs
示例2: json_encode
require_once '../../include/baseTheme.php';
require_once 'modules/search/indexer.class.php';
header('Content-Type: application/json; charset=utf-8');
// fetch number of courses waiting in index queue
$n = Database::get()->querySingle("SELECT COUNT(id) AS count FROM idx_queue")->count;
$rem = $n;
if ($n > 0) {
// fetch next waiting course
$cid = Database::get()->querySingle("SELECT course_id FROM idx_queue LIMIT 1")->course_id;
// re-index
$idx = new Indexer();
$idx->removeAllByCourse($cid);
$idx->storeAllByCourse($cid);
set_time_limit(0);
$idx->getIndex()->optimize();
// remove course from queue
Database::get()->query("DELETE FROM idx_queue WHERE course_id = ?d", $cid);
$rem = $n - 1;
}
$data = array(
"remaining" => $rem
);
echo json_encode($data);
exit();
示例3: optimizeIndex
/**
*
* @global type $webDir
*/
function optimizeIndex() {
global $webDir; // required for indexer
require_once 'modules/search/indexer.class.php';
$idx = new Indexer();
set_time_limit(0);
$idx->getIndex()->optimize();
}