Sphinx.class.php
748 Bytes
<?php
/**
* Sphinx使用类
*/
class Util_Se_Sphinx extends Util_Se_SphinxClient
{
public function __construct()
{
parent::SphinxClient();
$p = Util_Server::factory('Se', 'Sphinx')->loadBalanceServer();
parent::SetServer($p['host'], $p['port']);
}
public function UpdateAttributes ( $index, $attrs, $values, $mva=false )
{
$servers = Util_Server::factory('Se', 'Sphinx')->loadServers();
foreach($servers as $server)
{
$check = Util_Server_Adapter_CheckServer::check($server['host'], $server['port']);
if($check)
{
parent::SetServer($server['host'], $server['port']);
parent::UpdateAttributes ( $index, $attrs, $values, $mva);
}
}
}
}