Skip to content

Commit

Permalink
[Task][BC-Break] Unify OpenSearch and ElasticSearch (#207)
Browse files Browse the repository at this point in the history
* [WIP] Initial opensearch draft

* Apply php-cs-fixer changes

* Indexing works with opensearch

* add small cleanup

* add small cleanup

* Check productlisting with opensearch tenant

* Apply php-cs-fixer changes

* Replace elastic search everywhere

* add more cleanup

* add more cleanup

* add more cleanup

* Introduce tenantconfiginterface

* add interface for reindex and synonym update

* Apply php-cs-fixer changes

* Fix inteface

* Apply php-cs-fixer changes

* Remove deprication message and add method to interface

* Add missing methods

* Remove deprecation messages

* Readd warning for removed command

* Adding upgrade notes and renaming elasticWorker

---------

Co-authored-by: mattamon <[email protected]>
Co-authored-by: lukmzig <[email protected]>
Co-authored-by: lukmzig <[email protected]>
  • Loading branch information
4 people authored Nov 22, 2024
1 parent 82a567e commit 089274d
Show file tree
Hide file tree
Showing 24 changed files with 71 additions and 1,040 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To manually start a reindex, following command can be used: `bin/console ecommer

:::caution

The existing command `bin/console ecommerce:indexservice:search-elasticsearch-sync reindex` is deprecated and will be removed in 2.0.0.
The command `bin/console ecommerce:indexservice:search-elasticsearch-sync reindex` was removed in 2.0.0.

:::

Expand Down
10 changes: 10 additions & 0 deletions doc/19_Upgrade_Notes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Upgrade Notes

## Version 2.0.0

### [Elasticsearch]

- Removed ElasticSearchConfigInterface, use SearchConfigInterface instead.
- Removed EsSyncCommand it is now IndexSyncCommand. Use the ecommerce:indexservice:search-index-sync command instead.
- Introduced IndexRefreshInterface for refresh command.
- Moved ElasticSearch Filter Types to SearchIndex namespace. Make sure to update your filter namespaces in your yaml configuration.
100 changes: 0 additions & 100 deletions src/Command/IndexService/EsSyncCommand.php

This file was deleted.

11 changes: 5 additions & 6 deletions src/Command/IndexService/IndexSyncCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@

use Exception;
use Pimcore\Bundle\EcommerceFrameworkBundle\Factory;
use Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Worker\ElasticSearch\AbstractElasticSearch;
use Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Worker\OpenSearch\AbstractOpenSearch;
use Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Worker\IndexRefreshInterface;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -66,9 +65,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$bar = new ProgressBar($output, count($tenantList));

foreach ($tenantList as $tenantName) {
$elasticWorker = $indexService->getTenantWorker($tenantName); //e.g., 'AT_de_elastic'
$tenantWorker = $indexService->getTenantWorker($tenantName); //e.g., 'AT_de_elastic'

if (!$elasticWorker instanceof AbstractElasticSearch && !$elasticWorker instanceof AbstractOpenSearch) {
if (!$tenantWorker instanceof IndexRefreshInterface) {
$output->writeln("<info>Skipping tenant \"{$tenantName}\" as it's not a valid search index tenant.</info>");

continue;
Expand All @@ -78,8 +77,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int

try {
match ($mode) {
'reindex' => $elasticWorker->startReindexMode(),
'update-synonyms' => $elasticWorker->updateSynonyms(),
'reindex' => $tenantWorker->startReindexMode(),
'update-synonyms' => $tenantWorker->updateSynonyms(),
default => null,
};
} catch (Exception $e) {
Expand Down
61 changes: 0 additions & 61 deletions src/FilterService/FilterType/ElasticSearch/Input.php

This file was deleted.

102 changes: 0 additions & 102 deletions src/FilterService/FilterType/ElasticSearch/MultiSelect.php

This file was deleted.

Loading

0 comments on commit 089274d

Please sign in to comment.