From 0bb67246f16ec43cacea2515ba7ab0dc3aac4ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lepeltier?= Date: Wed, 2 Nov 2022 18:29:23 +0100 Subject: [PATCH 1/2] fix datacolector for retrieving _msearch queries body --- .../DataCollector/ElasticsearchDataCollector.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; From 98604823a1cfa99736636bebc7cf6799e4b0988a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lepeltier?= Date: Thu, 3 Nov 2022 11:58:42 +0100 Subject: [PATCH 2/2] allow php 7.2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" },