Skip to content

Commit

Permalink
Merge branch '1.x' into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
lukmzig committed Nov 21, 2024
2 parents 6a560f2 + 7c4a2f2 commit 286f520
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
16 changes: 16 additions & 0 deletions doc/01_Installation/02_Upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

Following steps are necessary during updating to newer versions.

## Upgrade to 1.3.0
- [Indexing] Added support for Elasticsearch in parallel to Opensearch. Opensearch remains the default search technology. If you are using Elasticsearch, you need to update your symfony configuration as follows:
```yml
pimcore_generic_data_index:
index_service:
client_params:
client_name: default
client_type: 'elasticsearch'
```
- [Indexing] Introduced new service alias `generic-data-index.search-client`. This will replace deprecated alias `generic-data-index.opensearch-client` which will be removed in the next major version.
The new service alias can be used to inject the search client into your services. This search client is an instance of `Pimcore\SearchClient\SearchClientInterface` which is a common interface for OpenSearch and Elasticsearch clients.
- Classes under OpenSearch namespaces are now deprecated and will be removed in the next major version. Please use the classes under the DefaultSearch namespace instead.
- Execute the following command to reindex all elements to be able to use all new features or when switching between OpenSearch and Elasticsearch:

```bin/console generic-data-index:update:index```

## Upgrade to 1.1.0
- Execute the following command to reindex all elements to be able to use all new features:

Expand Down
20 changes: 10 additions & 10 deletions src/DependencyInjection/PimcoreGenericDataIndexExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ private function registerIndexServiceParams(ContainerBuilder $container, array $
$definition->setArgument('$indexSettings', $indexSettings['index_settings']);
$definition->setArgument('$searchSettings', $indexSettings['search_settings']);
$definition->setArgument('$systemFieldsSettings', $indexSettings['system_fields_settings']);

$openSearchClientId = 'pimcore.open_search_client.' . $indexSettings['client_params']['client_name'];
$container->setAlias('generic-data-index.opensearch-client', $openSearchClientId)
->setDeprecated(
'pimcore/generic-data-index-bundle',
'1.3',
'The "%alias_id%" service alias is deprecated and will be removed in version 2.0. ' .
'Please use "generic-data-index.search-client" instead.'
);

if ($indexSettings['client_params']['client_type'] === ClientType::OPEN_SEARCH->value) {
$openSearchClientId = 'pimcore.open_search_client.' . $indexSettings['client_params']['client_name'];
$container->setAlias('generic-data-index.opensearch-client', $openSearchClientId)
->setDeprecated(
'pimcore/generic-data-index-bundle',
'1.3',
'The "%alias_id%" service alias is deprecated and will be removed in version 2.0. ' .
'Please use "generic-data-index.search-client" instead.'
);
}
$clientId = $this->getDefaultSearchClientId($indexSettings);
$container->setAlias('generic-data-index.search-client', $clientId);

Expand Down

0 comments on commit 286f520

Please sign in to comment.