Skip to content

Commit 70ccb98

Browse files
authored
[Task] Remove deprecations and OpenSearch class_aliases (#270)
* remove deprecations and update upgrade notes * add other changes related to bc breaks
1 parent f2f7788 commit 70ccb98

35 files changed

+43
-2069
lines changed

composer.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@
4343
"autoload": {
4444
"psr-4": {
4545
"Pimcore\\Bundle\\GenericDataIndexBundle\\": "src/"
46-
},
47-
"files": [
48-
"src/autoload.php"
49-
]
46+
}
5047
},
5148
"autoload-dev": {
5249
"psr-4": {

doc/01_Installation/02_Upgrade.md

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,39 @@
22

33
Following steps are necessary during updating to newer versions.
44

5+
## Upgrade to 2.0.0
6+
- [Indexing] Added inherited fields indicator to data object indexing
7+
- [Indexing] Added functionality to enqueue dependent items
8+
9+
### BC-Breaks
10+
- Removed deprecated alias `generic-data-index.opensearch-client` and replaced it with `generic-data-index.search-client`
11+
- Removed all deprecated classes from OpenSearch namespaces and replaced them with DefaultSearch namespace instead.
12+
- `Pimcore\Bundle\GenericDataIndexBundle\Model\OpenSearch` -> `Pimcore\Bundle\GenericDataIndexBundle\Model\DefaultSearch`
13+
- `Pimcore\Bundle\GenericDataIndexBundle\Enum\SearchIndex\OpenSearch` -> `Pimcore\Bundle\GenericDataIndexBundle\Enum\SearchIndex\DefaultSearch`
14+
- Removed deprecated class `Pimcore\Bundle\GenericDataIndexBundle\Exception\OpenSearch\SearchFailedException` please use `Pimcore\Bundle\GenericDataIndexBundle\Exception\OpenSearch\SearchFailedException` instead
15+
- Removed deprecated class `Pimcore\Bundle\GenericDataIndexBundle\Attribute\OpenSearch\AsSearchModifierHandler` please use `Pimcore\Bundle\GenericDataIndexBundle\Attribute\Search\AsSearchModifierHandler` instead
16+
- Removed deprecated class `Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\OpenSearch\Asset\FieldDefinitionAdapter\AbstractAdapter` please use `Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\DefaultSearch\Asset\FieldDefinitionAdapter\AbstractAdapter` instead
17+
- Removed deprecated class `Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\OpenSearch\DataObject\FieldDefinitionAdapter\AbstractAdapter` please use `Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\DefaultSearch\DataObject\FieldDefinitionAdapter\AbstractAdapter` instead
18+
- Added default prefix `data-object_` prefix to all data object class definition index names. This change is necessary to avoid conflicts with other index names.
19+
- Add element type to the `getIds` method of `Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Element\SearchResult\ElementSearchResult`
20+
21+
#### Interface changes
22+
- Added `PermissionTypes $permissionType` parameter with default type `PermissionTypes::LIST` to
23+
- `AssetSearchServiceInterface::search` method
24+
- `DocumentSearchServiceInterface::search` method
25+
- `DataObjectSearchServiceInterface::search` method
26+
- `ElementSearchServiceInterface::search` method
27+
- Search services `byId` methods now return elements based on the `PermissionTypes::VIEW` permission
28+
- Added type specific interfaces for searches to avoid mixing up different search types in search services
29+
- `AssetSearch` now implements `AssetSearchInterface`
30+
- `DocumentSearch` now implements `DocumentSearchInterface`
31+
- `ElementSearch` now implements `ElementSearchInterface`
32+
- Search services now require the specific search type for the search
33+
- `AssetSearchServiceInterface::search` now requires a `AssetSearchInterface`
34+
- `DocumentSearchServiceInterface::search` now requires a `DocumentSearchInterface`
35+
- `ElementSearchServiceInterface::search` now requires a `ElementSearchInterface`
36+
- `SearchProviderInterface` now returns type specific search interfaces
37+
538
## Upgrade to 1.3.0
639
- [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:
740
```yml
@@ -21,25 +54,4 @@ The new service alias can be used to inject the search client into your services
2154
## Upgrade to 1.1.0
2255
- Execute the following command to reindex all elements to be able to use all new features:
2356

24-
```bin/console generic-data-index:update:index```
25-
26-
## Upgrade to 2.0.0
27-
28-
### BC-Breaks
29-
30-
#### Interface changes
31-
- Added `PermissionTypes $permissionType` parameter with default type `PermissionTypes::LIST` to
32-
- `AssetSearchServiceInterface::search` method
33-
- `DocumentSearchServiceInterface::search` method
34-
- `DataObjectSearchServiceInterface::search` method
35-
- `ElementSearchServiceInterface::search` method
36-
- Search services `byId` methods now return elements based on the `PermissionTypes::VIEW` permission
37-
- Added type specific interfaces for searches to avoid mixing up different search types in search services
38-
- `AssetSearch` now implements `AssetSearchInterface`
39-
- `DocumentSearch` now implements `DocumentSearchInterface`
40-
- `ElementSearch` now implements `ElementSearchInterface`
41-
- Search services now require the specific search type for the search
42-
- `AssetSearchServiceInterface::search` now requires a `AssetSearchInterface`
43-
- `DocumentSearchServiceInterface::search` now requires a `DocumentSearchInterface`
44-
- `ElementSearchServiceInterface::search` now requires a `ElementSearchInterface`
45-
- `SearchProviderInterface` now returns type specific search interfaces
57+
```bin/console generic-data-index:update:index```

src/Attribute/OpenSearch/AsSearchModifierHandler.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/DependencyInjection/PimcoreGenericDataIndexExtension.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,14 @@ private function registerIndexServiceParams(ContainerBuilder $container, array $
9090
$definition->setArgument('$indexSettings', $indexSettings['index_settings']);
9191
$definition->setArgument('$searchSettings', $indexSettings['search_settings']);
9292
$definition->setArgument('$systemFieldsSettings', $indexSettings['system_fields_settings']);
93-
if ($indexSettings['client_params']['client_type'] === ClientType::OPEN_SEARCH->value) {
94-
$openSearchClientId = 'pimcore.open_search_client.' . $indexSettings['client_params']['client_name'];
95-
$container->setAlias('generic-data-index.opensearch-client', $openSearchClientId)
96-
->setDeprecated(
97-
'pimcore/generic-data-index-bundle',
98-
'1.3',
99-
'The "%alias_id%" service alias is deprecated and will be removed in version 2.0. ' .
100-
'Please use "generic-data-index.search-client" instead.'
101-
);
102-
}
93+
10394
$clientId = $this->getDefaultSearchClientId($indexSettings);
10495
$container->setAlias('generic-data-index.search-client', $clientId);
10596

106-
$container->setParameter('generic-data-index.index-prefix', $indexSettings['client_params']['index_prefix']);
97+
$container->setParameter(
98+
'generic-data-index.index-prefix',
99+
$indexSettings['client_params']['index_prefix']
100+
);
107101

108102
$definition = $container->getDefinition(DispatchQueueMessagesHandler::class);
109103
$definition->setArgument('$queueSettings', $indexSettings['queue_settings']);

src/Enum/SearchIndex/OpenSearch/AttributeType.php

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/Enum/SearchIndex/OpenSearch/ConditionType.php

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/Enum/SearchIndex/OpenSearch/QueryType.php

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/Enum/SearchIndex/OpenSearch/WildcardFilterMode.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/Exception/OpenSearch/SearchFailedException.php

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/Model/DefaultSearch/Debug/SearchInformation.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
*/
2424
final class SearchInformation
2525
{
26-
// ToDo make constants public in 2.0
27-
public const VERBOSITY_VERBOSE = 2;
26+
private const VERBOSITY_VERBOSE = 2;
2827

29-
public const VERBOSITY_VERY_VERBOSE = 3;
28+
private const VERBOSITY_VERY_VERBOSE = 3;
3029

3130
public function __construct(
3231
private readonly AdapterSearchInterface $search,

0 commit comments

Comments
 (0)