Бугагашечка от PHP для невнимательных Broken pipe & Connection closed by peer в SphinxClient::UpdateAttributes() [PHP]
Feb 16

Столкнулся с проблемой, при попытке заапдейтить большой массив айдишек. Searchd ругается на 8кб с копейками запрос и клозит соединение.. Решение - разбить массив айди на несколько частей :)

Например вот так:

/*................................*/
            if(count($id) > 500) {
                $id = array_chunk($id, 500, true);
                foreach($id as $v)
                    $cl->UpdateAttributes('shop', array($this->table), $v);
            } else
                $cl->UpdateAttributes('shop', array($this->table), $id);
/*................................*/

No related posts.

Leave a Reply

This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)

You must read and type the 5 chars within 0..9 and A..F, and submit the form.

  

Oh no, I cannot read this. Please, generate a