58 $this->options = array_merge(
62 'ignore_error' =>
false,
82 return parent::setFormatter($formatter);
84 throw new \InvalidArgumentException(
'ElasticSearchHandler is only compatible with ElasticaFormatter');
109 $documents = $this->
getFormatter()->formatBatch($records);
121 $this->client->addDocuments($documents);
122 }
catch (ExceptionInterface $e) {
123 if (!$this->options[
'ignore_error']) {
124 throw new \RuntimeException(
"Error sending messages to Elasticsearch", 0, $e);
const DEBUG
Detailed debug information.
bulkSend(array $documents)
Use Elasticsearch bulk API to send list of documents.
__construct(Client $client, array $options=array(), $level=Logger::DEBUG, $bubble=true)
Base Handler class providing the Handler structure.
getOptions()
Getter options.
handleBatch(array $records)
{Handles a set of records at once.The records to handle (an array of record arrays)} ...
setFormatter(FormatterInterface $formatter)
{Sets the formatter.self}
getFormatter()
{Gets the formatter.FormatterInterface}
Create styles array
The data for the language used.