diff --git a/Result/Converter.php b/Result/Converter.php index 096e29cb..db8e6252 100644 --- a/Result/Converter.php +++ b/Result/Converter.php @@ -53,6 +53,8 @@ public function convertToDocument($rawData, Manager $manager) if (isset($types[$rawData['_type']])) { $metadata = $types[$rawData['_type']]; + } elseif ($rawData['_type'] === '_doc') { + $metadata = reset($types); } else { throw new \LogicException("Got document of unknown type '{$rawData['_type']}'."); } diff --git a/Service/ManagerFactory.php b/Service/ManagerFactory.php index 0cb81d41..4d0bcd73 100644 --- a/Service/ManagerFactory.php +++ b/Service/ManagerFactory.php @@ -136,6 +136,17 @@ public function createManager($managerName, $connection, $analysis, $managerConf if (version_compare($elasticSearchVersion, '7.0.0', '>=')) { $indexSettings['include_type_name'] = true; + + 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 &&