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


PHP Indexer::clearoutDeleted方法代码示例

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


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

示例1: getDocumentsQueue

 /**
  * Get the queue of documents for indexing
  * Refactored from indexDocuments()
  */
 public function getDocumentsQueue($max = null)
 {
     global $default;
     // Cleanup the queue
     Indexer::clearoutDeleted();
     $date = date('Y-m-d H:i:s');
     // identify the indexers that must run
     // mysql specific limit!
     $sql = "SELECT\n        \t\t\tiff.document_id, mt.filetypes, mt.mimetypes, me.name as extractor, iff.what\n\t\t\t\tFROM\n\t\t\t\t\tindex_files iff\n\t\t\t\t\tINNER JOIN documents d ON iff.document_id=d.id\n\t\t\t\t\tINNER JOIN document_metadata_version dmv ON d.metadata_version_id=dmv.id\n\t\t\t\t\tINNER JOIN document_content_version dcv ON dmv.content_version_id=dcv.id\n\t\t\t\t\tINNER JOIN mime_types mt ON dcv.mime_id=mt.id\n\t\t\t\t\tLEFT JOIN mime_extractors me ON mt.extractor_id=me.id\n \t\t\t\tWHERE\n \t\t\t\t\t(iff.processdate IS NULL or iff.processdate < date_sub('{$date}', interval 1 day)) AND dmv.status_id=1\n\t\t\t\tORDER BY indexdate\n \t\t\t\t\tLIMIT {$max}";
     $result = DBUtil::getResultArray($sql);
     if (PEAR::isError($result)) {
         //unlink($indexLockFile);
         if ($this->debug) {
             $default->log->error('indexDocuments: stopping - db error');
         }
         return;
     }
     KTUtil::setSystemSetting('luceneIndexingDate', time());
     // bail if no work to do
     if (count($result) == 0) {
         //unlink($indexLockFile);
         if ($this->debug) {
             $default->log->debug('indexDocuments: stopping - no work to be done');
         }
         return;
     }
     // identify any documents that need indexing and mark them
     // so they are not taken in a followup run
     $ids = array();
     foreach ($result as $docinfo) {
         $ids[] = $docinfo['document_id'];
     }
     // mark the documents as being processed
     $ids = implode(',', $ids);
     $sql = "UPDATE index_files SET processdate='{$date}' WHERE document_id in ({$ids})";
     DBUtil::runQuery($sql);
     return $result;
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:42,代码来源:indexerCore.inc.php


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