From 244888736fed91a2d0ca2a6dfc0554ef616711f2 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Thu, 21 Apr 2022 04:18:23 +0200 Subject: [PATCH] Fix content and accept type problems --- Service/ManagerFactory.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Service/ManagerFactory.php b/Service/ManagerFactory.php index 89c491f3..4d0bcd73 100644 --- a/Service/ManagerFactory.php +++ b/Service/ManagerFactory.php @@ -137,14 +137,16 @@ public function createManager($managerName, $connection, $analysis, $managerConf if (version_compare($elasticSearchVersion, '7.0.0', '>=')) { $indexSettings['include_type_name'] = true; - $client->setConnectionParams([ - 'client' => [ - 'headers' => [ - 'Accept' => ['application/vnd.elasticsearch+json;compatible-with=7'], - 'Content-Type' => ['application/vnd.elasticsearch+json;compatible-with=7'], + if (version_compare($elasticSearchVersion, '7.11.0', '>=')) { + $client->setConnectionParams([ + 'client' => [ + 'headers' => [ + 'Accept' => ['application/vnd.elasticsearch+json;compatible-with=7'], + 'Content-Type' => ['application/vnd.elasticsearch+json;compatible-with=7'], + ] ] - ] - ]); + ]); + } } $this->eventDispatcher &&