diff --git a/composer.json b/composer.json index c1cdd08..cfabb26 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": ">=7.4", + "php": ">=7.2", "ext-json": "*", "elasticsearch/elasticsearch": "^5.1.0||^6.0.0||^7.0" }, diff --git a/src/M6Web/Bundle/ElasticsearchBundle/DataCollector/ElasticsearchDataCollector.php b/src/M6Web/Bundle/ElasticsearchBundle/DataCollector/ElasticsearchDataCollector.php index 39fc745..ec2b580 100644 --- a/src/M6Web/Bundle/ElasticsearchBundle/DataCollector/ElasticsearchDataCollector.php +++ b/src/M6Web/Bundle/ElasticsearchBundle/DataCollector/ElasticsearchDataCollector.php @@ -31,7 +31,13 @@ public function handleEvent(ElasticsearchEvent $event) 'status_code' => $event->getStatusCode(), 'duration' => $event->getDuration(), 'took' => $event->getTook(), - 'body' => json_decode($event->getBody()), + 'body' => $event->getUri() != '/_msearch' ? + json_decode($event->getBody()) : + array_map(function ($str) { + return json_decode($str); + }, + array_filter(explode(PHP_EOL, $event->getBody())) + ), 'error' => $event->getError(), ]; $this->data['queries'][] = $query;