Quote:
Originally Posted by amcd
this will not work in a multi-server setup.
|
True, I'm not there yet with multiple servers.

Use this instead:
Code:
$cl = new SphinxClient();
$cl->SetServer($sphinx_server, $sphinx_port);
$cl->SetLimits(0, $vbulletin->options['maxresults']);
$cl->SetMatchMode(SPH_MATCH_ALL);
...
$res = $cl->Query($vbulletin->GPC['query'] , $sphinx_index);
...
if (!is_array($res))
{
$sphinxerror = $cl->GetLastError();
if ($sphinxerror)
{
// server not running
}
}
I run a failsafe on my server... if searchd is crashing, vbulletin search will take over automatically.
Edit: Let me dig into this more... I think that searchd will still spit an error, even if it's running, something like (no error).
I will post at sphinx site to ask Andrew how exacly the last error works.