public function finalize()
	{
		try
		{
			if (isset($this->bufferAdd))
			{
				$this->bufferAdd->flush($this->overwrite, $this->commitWithin);
			}
			return null;
		}
		catch (\Solarium\Exception\HttpException $e)
		{
			$body = json_decode($e->getBody());
			$message = isset($body->error->msg) ? $body->error->msg : $e->getStatusMessage();
			return $message;
		}
	}
public function finalize()
	{
		try
		{
			if (isset($this->bufferAdd))
			{
				$this->bufferAdd->flush($this->overwrite, $this->commitWithin);
			}
			return null;
		}
		catch (\Solarium\Exception\HttpException $e)
		{
			$body = json_decode($e->getBody());
			$message = isset($body->error->msg) ? $body->error->msg : $e->getStatusMessage();
			return $message;
		}
	}
public function finalize ( ) { try { if ( isset ( $ this -> bufferAdd ) ) { $ this -> bufferAdd -> flush ( $ this -> overwrite , $ this -> commitWithin ) ; } return null ; } catch ( \ Solarium \ Exception \ HttpException $ e ) { $ body = json_decode ( $ e -> getBody ( ) ) ; $ message = isset ( $ body -> error -> msg ) ? $ body -> error -> msg : $ e -> getStatusMessage ( ) ; return $ message ; } }
Automatically flushes any remaining documents in the buffer

@return mixed string if error caught/ null if successful
Automatically flushes any remaining documents in the buffer