lib/Elastica/Response.php
public function isOk()
    {
        $data = $this->getData();

        // Bulk insert checks. Check every item
        if (isset($data['status'])) {
            return $data['status'] >= 200 && $data['status'] <= 300;
        }

        if (isset($data['items'])) {
            if (isset($data['errors']) && true === $data['errors']) {
                return false;
            }

            foreach ($data['items'] as $item) {
                if (isset($item['index']['ok']) && false == $item['index']['ok']) {
                    return false;
                }

                if (isset($item['index']['status']) && ($item['index']['status'] < 200 || $item['index']['status'] >= 300)) {
                    return false;
                }
            }

            return true;
        }

        if ($this->_status >= 200 && $this->_status <= 300) {
            // http status is ok
            return true;
        }

        return isset($data['ok']) && $data['ok'];
    }
public function isOk()
    {
        $data = $this->getData();

        // Bulk insert checks. Check every item
        if (isset($data['status'])) {
            return $data['status'] >= 200 && $data['status'] <= 300;
        }

        if (isset($data['items'])) {
            if (isset($data['errors']) && true === $data['errors']) {
                return false;
            }

            foreach ($data['items'] as $item) {
                if (isset($item['index']['ok']) && false == $item['index']['ok']) {
                    return false;
                }

                if (isset($item['index']['status']) && ($item['index']['status'] < 200 || $item['index']['status'] >= 300)) {
                    return false;
                }
            }

            return true;
        }

        if ($this->_status >= 200 && $this->_status <= 300) {
            // http status is ok
            return true;
        }

        return isset($data['ok']) && $data['ok'];
    }
public function isOk ( ) { $ data = $ this -> getData ( ) ; // Bulk insert checks. Check every item if ( isset ( $ data [ 'status' ] ) ) { return $ data [ 'status' ] >= 200 && $ data [ 'status' ] <= 300 ; } if ( isset ( $ data [ 'items' ] ) ) { if ( isset ( $ data [ 'errors' ] ) && true === $ data [ 'errors' ] ) { return false ; } foreach ( $ data [ 'items' ] as $ item ) { if ( isset ( $ item [ 'index' ] [ 'ok' ] ) && false == $ item [ 'index' ] [ 'ok' ] ) { return false ; } if ( isset ( $ item [ 'index' ] [ 'status' ] ) && ( $ item [ 'index' ] [ 'status' ] < 200 || $ item [ 'index' ] [ 'status' ] >= 300 ) ) { return false ; } } return true ; } if ( $ this -> _status >= 200 && $ this -> _status <= 300 ) { // http status is ok return true ; } return isset ( $ data [ 'ok' ] ) && $ data [ 'ok' ] ; }
Checks if the query returned ok.

@return bool True if ok
Checks if the query returned ok .