diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml index efe6e8d6..bfeade82 100644 --- a/.github/workflows/test-application.yaml +++ b/.github/workflows/test-application.yaml @@ -64,6 +64,22 @@ jobs: - php-version: '8.1' elasticsearch-version: '7.11.1' elasticsearch-package-constraint: '~7.11.0' + minimum-stability: 'stable' + dependency-versions: 'highest' + tools: 'composer:v2' + php-cs-fixer: false + + - php-version: '8.2' + elasticsearch-version: '8.7.0' + elasticsearch-package-constraint: '~7.11.0' + minimum-stability: 'stable' + dependency-versions: 'highest' + tools: 'composer:v2' + php-cs-fixer: false + + - php-version: '8.2' + elasticsearch-version: '8.7.0' + elasticsearch-package-constraint: '~7.11.0' minimum-stability: 'dev' dependency-versions: 'highest' tools: 'composer:v2' @@ -117,5 +133,4 @@ jobs: run: vendor/bin/behat --suite=zend_lucene - name: Execute elastic behat tests - if: ${{ matrix.php-version < '8.0' }} # requires fixing elastic tests on 7.11 (sorting) run: vendor/bin/behat --suite=elastic diff --git a/Search/Adapter/ElasticSearchAdapter.php b/Search/Adapter/ElasticSearchAdapter.php index 19daa02e..be05b206 100644 --- a/Search/Adapter/ElasticSearchAdapter.php +++ b/Search/Adapter/ElasticSearchAdapter.php @@ -78,6 +78,17 @@ public function __construct(Factory $factory, ElasticSearchClient $client, $vers $this->factory = $factory; $this->client = $client; $this->version = $version; + + if (version_compare($this->version, '7.11.0', '>=')) { + $client->setConnectionParams([ + 'client' => [ + 'headers' => [ + 'Accept' => ['application/vnd.elasticsearch+json;compatible-with=7'], + 'Content-Type' => ['application/vnd.elasticsearch+json;compatible-with=7'], + ] + ] + ]); + } } public function index(Document $document, $indexName) diff --git a/Search/ObjectToDocumentConverter.php b/Search/ObjectToDocumentConverter.php index 7c561150..597e7f6b 100644 --- a/Search/ObjectToDocumentConverter.php +++ b/Search/ObjectToDocumentConverter.php @@ -181,7 +181,7 @@ private function populateDocument( $type = $mapping['type']; /** @var FieldInterface $mappingField */ $mappingField = $mapping['field']; - $condition = method_exists($mappingField, 'getCondition') ? $mappingField->getCondition() : null; + $condition = \method_exists($mappingField, 'getCondition') ? $mappingField->getCondition() : null; $validField = $condition ? $this->fieldEvaluator->evaluateCondition($object, $condition) : true; if (false === $validField) {