From 68fb71214e086ad33468f052e8a20cbbae472b2d Mon Sep 17 00:00:00 2001 From: Enrico Zimuel Date: Tue, 4 Apr 2023 21:40:25 +0200 Subject: [PATCH 1/5] Updated endpoints to 8.7.0 --- src/AppSearch/Request/IndexDocuments.php | 1 + src/AppSearch/Request/PutDocuments.php | 1 + src/AppSearch/Schema/SearchRequestParams.php | 2 +- src/WorkplaceSearch/Request/IndexDocuments.php | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/AppSearch/Request/IndexDocuments.php b/src/AppSearch/Request/IndexDocuments.php index 533f226..b9ef502 100644 --- a/src/AppSearch/Request/IndexDocuments.php +++ b/src/AppSearch/Request/IndexDocuments.php @@ -16,6 +16,7 @@ namespace Elastic\EnterpriseSearch\AppSearch\Request; +use Elastic\EnterpriseSearch\AppSearch\Schema\Document; use Elastic\EnterpriseSearch\Request\Request; /** diff --git a/src/AppSearch/Request/PutDocuments.php b/src/AppSearch/Request/PutDocuments.php index 566e2f7..cda24cb 100644 --- a/src/AppSearch/Request/PutDocuments.php +++ b/src/AppSearch/Request/PutDocuments.php @@ -16,6 +16,7 @@ namespace Elastic\EnterpriseSearch\AppSearch\Request; +use Elastic\EnterpriseSearch\AppSearch\Schema\Document; use Elastic\EnterpriseSearch\Request\Request; /** diff --git a/src/AppSearch/Schema/SearchRequestParams.php b/src/AppSearch/Schema/SearchRequestParams.php index 20f0a99..303ec44 100644 --- a/src/AppSearch/Schema/SearchRequestParams.php +++ b/src/AppSearch/Schema/SearchRequestParams.php @@ -23,7 +23,7 @@ class SearchRequestParams { public string $query; public SimpleObject $analytics; - public SearchBoosts $boost; + public SearchBoosts $boosts; public SimpleObject $facets; public SimpleObject $filters; public SimpleObject $group; diff --git a/src/WorkplaceSearch/Request/IndexDocuments.php b/src/WorkplaceSearch/Request/IndexDocuments.php index a09ede4..7453d87 100644 --- a/src/WorkplaceSearch/Request/IndexDocuments.php +++ b/src/WorkplaceSearch/Request/IndexDocuments.php @@ -17,6 +17,7 @@ namespace Elastic\EnterpriseSearch\WorkplaceSearch\Request; use Elastic\EnterpriseSearch\Request\Request; +use Elastic\EnterpriseSearch\WorkplaceSearch\Schema\Document; /** * Indexes one or more new documents into a custom content source, or updates one or more existing documents From b5246a37555c61d5d69fdc913f180386ca7f5c3d Mon Sep 17 00:00:00 2001 From: Enrico Zimuel Date: Tue, 4 Apr 2023 21:58:38 +0200 Subject: [PATCH 2/5] Updated VERSION to 8.7.0 --- ...-php+8.5.yml => elastic+enterprise-search-php+8.7.yml} | 8 ++++---- src/Client.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) rename .ci/jobs/{elastic+enterprise-search-php+8.5.yml => elastic+enterprise-search-php+8.7.yml} (56%) diff --git a/.ci/jobs/elastic+enterprise-search-php+8.5.yml b/.ci/jobs/elastic+enterprise-search-php+8.7.yml similarity index 56% rename from .ci/jobs/elastic+enterprise-search-php+8.5.yml rename to .ci/jobs/elastic+enterprise-search-php+8.7.yml index df3e581..0424f65 100644 --- a/.ci/jobs/elastic+enterprise-search-php+8.5.yml +++ b/.ci/jobs/elastic+enterprise-search-php+8.7.yml @@ -1,12 +1,12 @@ --- - job: - name: elastic+enterprise-search-php+8.5 - display-name: 'elastic / enterprise-search-php # 8.5' - description: Testing the enterprise-search-php 8.5 branch. + name: elastic+enterprise-search-php+8.7 + display-name: 'elastic / enterprise-search-php # 8.7' + description: Testing the enterprise-search-php 8.7 branch. parameters: - string: name: branch_specifier - default: refs/heads/8.5 + default: refs/heads/8.7 description: the Git branch specifier to build (<branchName>, <tagName>, <commitId>, etc.) triggers: diff --git a/src/Client.php b/src/Client.php index 98b23da..abff484 100644 --- a/src/Client.php +++ b/src/Client.php @@ -24,7 +24,7 @@ class Client { - const VERSION = '8.6.0'; + const VERSION = '8.7.0'; private array $config = []; From 63685d6b44bfa0eba4633a12b61c04b25a8e29f4 Mon Sep 17 00:00:00 2001 From: Enrico Zimuel Date: Tue, 4 Apr 2023 22:07:13 +0200 Subject: [PATCH 3/5] Updated CHANGELOG to 8.7.0 --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d5c3b9..a2bab9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 8.7.0 (2023-04-04) + +Release compatible with Enterprise Search, App Search and Workplace Search 8.7. + +- Fixed incorrect property name `boost` for `SearchRequestParams` in AppSearch + [#35](https://github.com/elastic/enterprise-search-php/issues/35) +- Fixed Document class in `AppSearch\Request\IndexDocuments` + [#30](https://github.com/elastic/enterprise-search-php/issues/30) + +## 8.6.0 (2023-01-27) + +Release compatible with Enterprise Search, App Search and Workplace Search 8.6. + ## 8.5.0 (2022-11-07) Release compatible with Enterprise Search, App Search and Workplace Search 8.5. From 084ab6e625ae448ebec75f2dfb2d00d1c8d1267d Mon Sep 17 00:00:00 2001 From: Ramon Nijman Date: Thu, 1 Jun 2023 14:11:01 +0200 Subject: [PATCH 4/5] changed setting Accept-Encoding header # # Hier eventueel een uitleg over de wijziging ten op zichte van de # vorige versie max. 72 tekens per regel. # # Eventuele breaking changes hier vermelden en ook verwijzingen naar # tickets en andere resources. # Jira #WST-123 # Zie ook: http://podio.com/webstores/klant/stories/432 --- composer.json | 3 ++- src/Client.php | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index e3f9b4f..5cbb24e 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,8 @@ "require-dev": { "phpunit/phpunit": "^9.5", "guzzlehttp/guzzle": "^7.0", - "phpstan/phpstan": "^1.8" + "phpstan/phpstan": "^1.8", + "symfony/http-client": "^6.0" }, "suggest": { "guzzlehttp/guzzle": "We suggest to use Guzzle as PSR-18 HTTP library" diff --git a/src/Client.php b/src/Client.php index 98b23da..a22186a 100644 --- a/src/Client.php +++ b/src/Client.php @@ -110,7 +110,9 @@ private function initTransport(Transport $transport, array $config): void if (!isset($config['meta-header']) || $config['meta-header']) { $transport->setElasticMetaHeader('ent', self::VERSION); } - $transport->setHeader('Accept-Encoding', 'gzip'); + if (!$this->isSymfonyHttpClient($transport)) { + $transport->setHeader('Accept-Encoding', 'gzip'); + } } /** @@ -185,4 +187,15 @@ private function setAuthentication(Transport $transport, array $config, string $ 'You need to use an authentication method: username and password, token or apiKey' ); } + + private function isSymfonyHttpClient(Transport $transport): bool + { + if (false !== strpos(get_class($transport->getClient()), 'Symfony\Component\HttpClient')) { + return true; + } + if (false !== strpos(get_class($transport->getAsyncClient()), 'Symfony\Component\HttpClient')) { + return true; + } + return false; + } } \ No newline at end of file From 7dd83e204fe13de87bfc29a917bec9d98402dff0 Mon Sep 17 00:00:00 2001 From: Ramon Nijman Date: Thu, 1 Jun 2023 14:13:40 +0200 Subject: [PATCH 5/5] Updated CHANGELOG to 8.7.1 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2bab9f..3be1ea3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 8.7.1 (2023-06-01) + +- Removes Accept-Encoding (gzip) header when using Symfony HTTP client + ## 8.7.0 (2023-04-04) Release compatible with Enterprise Search, App Search and Workplace Search 8.7.