original_string: public function update(array $data, array $parameters = []) {
          if (!$this->canAlter()) {
              throw new Exception('Need index, type, and key to update a document');
          }
          if (!$this->esClient) {
              throw new Exception('Need ElasticSearch client object for ALTER operations');
          }
          $params = [
              'index' => $this->meta['index'],
              'type' => $this->meta['type'],
              'id' => $this->meta['id'],
              'body' => $data] + $parameters;
          return $this->esClient->update($params);
      }
code: public function update(array $data, array $parameters = []) {
          if (!$this->canAlter()) {
              throw new Exception('Need index, type, and key to update a document');
          }
          if (!$this->esClient) {
              throw new Exception('Need ElasticSearch client object for ALTER operations');
          }
          $params = [
              'index' => $this->meta['index'],
              'type' => $this->meta['type'],
              'id' => $this->meta['id'],
              'body' => $data] + $parameters;
          return $this->esClient->update($params);
      }
code_tokens: public function update ( array $ data , array $ parameters = [ ] ) { if ( ! $ this -> canAlter ( ) ) { throw new Exception ( 'Need index, type, and key to update a document' ) ; } if ( ! $ this -> esClient ) { throw new Exception ( 'Need ElasticSearch client object for ALTER operations' ) ; } $ params = [ 'index' => $ this -> meta [ 'index' ] , 'type' => $ this -> meta [ 'type' ] , 'id' => $ this -> meta [ 'id' ] , 'body' => $ data ] + $ parameters ; return $ this -> esClient -> update ( $ params ) ; }
docstring: Updates the document
  
  @param array $data the normal elastic update parameters to be used
  @param array $parameters the parameters array
  @return array
  @throws Exception
docstring_tokens: Updates the document