1

我正在尝试获取一些长时间执行的查询的结果。每个查询具有相同的结构:

    @CODE (ZZZZZZ|YYYYY...) @FIELD2 YES

每个查询在 70-100 秒内成功完成(我searchd --console用来检查它)。但是 PHP 代码停止等待第 60 秒的响应并丢弃一个错误

  received zero-sized searchd response 

看起来连接断开了?我正在使用常规的 SphinxClient。调用 sphinx 搜索的 PHP 代码如下所示:

$this->client->SetServer($this->host, $this->port);
$this->client->SetArrayResult(true);
$this->client->SetWeights(array(100, 1));
$this->client->SetMatchMode($this->mode);
$this->client->SetMaxQueryTime(5000000);
$this->client->SetLimits($this->offset, $this->limit, ($this->limit > 1000) ? $this->limit : 1000);
$this->result = $this->client->Query($this->query, $this->index);

PHP 配置为

max_execution_time = 120
max_input_time = 120

这是否可以设置一些系统设置 - 所以脚本将能够等待更长时间的响应?我正在使用 Debian GNU/Linux 5.0.3 Lenny

4

1 回答 1

3

您是否尝试过设置 setConnectionTimeout?

http://sphinxsearch.com/docs/current.html#api-func-setconnecttimeout


虽然设置 stream_set_timeout 可能会更好 http://www.php.net/manual/en/function.stream-set-timeout.php 必须热连 sphinxapi.php 才能添加对它的调用。

于 2013-03-28T13:07:31.110 回答