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


PHP eZSolr::commit方法代码示例

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


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

示例1: exec

    $limit = 10;
    $continue = false;
    
    $cli->output($row['path']);
    
    do 
    {
        $cmd = "{$php} extension/ezfind/bin/php/updatesearchindexsolr.php -s site_admin --topNodeID=${row['node_id']} --limit={$limit} --offset={$offset} 2>/dev/null";
        $cli->output("\t".$offset);
        exec( $cmd, $out );
        $lastLine = array_pop($out);
        
        if ( trim($lastLine) == $limit )
        {
            $continue = true;
            $offset += $limit;
        }
        else
        {
            $continue = false;
        }
    }
    while ($continue);
}


$solr = new eZSolr();
$solr->commit();

$script->shutdown(0);
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:30,代码来源:indexlocale.php

示例2: indexnode

 private function indexnode($nodeId)
 {
     $engine = new eZSolr();
     $node = eZContentObjectTreeNode::fetch($nodeId);
     $object = eZContentObject::fetch($node->attribute('contentobject_id'));
     if ($object) {
         $result = $engine->addObject($object, false);
         $engine->commit();
     }
 }
开发者ID:truffo,项目名称:eep,代码行数:10,代码来源:index.php

示例3: catch

                if ($object) {
                    if ($needRemoveWithUpdate) {
                        $searchEngine->removeObject($object, false);
                    }
                    $removeFromPendingActions = $searchEngine->addObject($object, false);
                }
                if ($removeFromPendingActions) {
                    $db->query("DELETE FROM ezpending_actions WHERE action = 'index_object' AND param = '{$objectID}'");
                } else {
                    $cli->warning("\tFailed indexing object ID #{$objectID}, keeping it in the queue.");
                    // Increase the offset to skip failing objects
                    ++$offset;
                }
                $db->commit();
            }
            $searchEngine->commit();
            // clear object cache to conserve memory
            eZContentObject::clearCache();
        } else {
            break;
            // No valid result from ezpending_actions
        }
    }
    $cli->output("Done");
    $script->shutdown();
} catch (Exception $e) {
    $errCode = $e->getCode();
    $errCode = $errCode != 0 ? $errCode : 1;
    // If an error has occured, script must terminate with a status other than 0
    $script->shutdown($errCode, $e->getMessage());
}
开发者ID:OpencontentCoop,项目名称:ocsearchtools,代码行数:31,代码来源:reindex_by_class.php


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