Games-of-Switzerland / swissgamesgarden

👾 🇨🇭 Games of Switzerland - React Frontend Application
https://swissgames.garden
GNU General Public License v2.0
14 stars 1 forks source link

Upgrade to Elasticsearch 8 #143

Closed WengerK closed 6 months ago

WengerK commented 7 months ago

💬 Description de la demande

Upgrade to Elasticsearch 8.x

🔢 Tâches

composer require drupal/elasticsearch_helper:^8.1 elasticsearch/elasticsearch:8.7.* -W

Lock file operations: 1 install, 5 updates, 2 removals
  - Removing ezimuel/guzzlestreams (3.1.0)
  - Removing ezimuel/ringphp (1.2.2)
  - Upgrading drupal/elasticsearch_helper (dev-6.x 1443af5 => 8.1.0)
  - Locking elastic/transport (v8.8.0)
  - Upgrading elasticsearch/elasticsearch (v6.8.2 => v8.7.1)
  - Upgrading phpdocumentor/type-resolver (1.8.0 => 1.8.1)
  - Downgrading psr/http-message (2.0 => 1.1)
  - Upgrading react/promise (v2.11.0 => v3.1.0)
Writing lock file

We can't upgrade higher than 8.7 because elastic require psr/http-message 1.1 | 2.0 but Drupal require psr-http-message 1.0

/**
 * The elasticsearch host.
 *
 * @var string
 */
-$config['elasticsearch_helper.settings']['elasticsearch_helper']['host'] = 'elasticsearch';
-$config['elasticsearch_helper.settings']['elasticsearch_helper']['port'] = '9200';
+$config['elasticsearch_helper.settings']['hosts'][0]['host'] = 'elasticsearch';
+$config['elasticsearch_helper.settings']['hosts'][0]['port'] = '9200';

💣 Breaking Changes

elasticsearch response hits.total become hits.total.value

{
    "hits": {
-       "total": 10
+       "total": {
+           "value": 10,
+           "relation": "eq"
        },
    }
}