Skip to content

Commit

Permalink
remove deprecations and update upgrade notes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukmzig committed Dec 17, 2024
1 parent f2f7788 commit 1d9a517
Show file tree
Hide file tree
Showing 33 changed files with 40 additions and 2,050 deletions.
5 changes: 1 addition & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@
"autoload": {
"psr-4": {
"Pimcore\\Bundle\\GenericDataIndexBundle\\": "src/"
},
"files": [
"src/autoload.php"
]
}
},
"autoload-dev": {
"psr-4": {
Expand Down
56 changes: 34 additions & 22 deletions doc/01_Installation/02_Upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,39 @@

Following steps are necessary during updating to newer versions.

## Upgrade to 2.0.0
- [Indexing] Added inherited fields indicator to data object indexing
- [Indexing] Added functionality to enqueue dependent items

### BC-Breaks
- Removed deprecated alias `generic-data-index.opensearch-client` and replaced it with `generic-data-index.search-client`
- Removed all deprecated classes from OpenSearch namespaces and replaced them with DefaultSearch namespace instead.
- `Pimcore\Bundle\GenericDataIndexBundle\Model\OpenSearch` -> `Pimcore\Bundle\GenericDataIndexBundle\Model\DefaultSearch`
- `Pimcore\Bundle\GenericDataIndexBundle\Enum\SearchIndex\OpenSearch` -> `Pimcore\Bundle\GenericDataIndexBundle\Enum\SearchIndex\DefaultSearch`
- Removed deprecated class `Pimcore\Bundle\GenericDataIndexBundle\Exception\OpenSearch\SearchFailedException` please use `Pimcore\Bundle\GenericDataIndexBundle\Exception\OpenSearch\SearchFailedException` instead
- Removed deprecated class `Pimcore\Bundle\GenericDataIndexBundle\Attribute\OpenSearch\AsSearchModifierHandler` please use `Pimcore\Bundle\GenericDataIndexBundle\Attribute\Search\AsSearchModifierHandler` instead
- Removed deprecated class `Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\OpenSearch\Asset\FieldDefinitionAdapter\AbstractAdapter` please use `Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\DefaultSearch\Asset\FieldDefinitionAdapter\AbstractAdapter` instead
- Removed deprecated class `Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\OpenSearch\DataObject\FieldDefinitionAdapter\AbstractAdapter` please use `Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\DefaultSearch\DataObject\FieldDefinitionAdapter\AbstractAdapter` instead
- 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.
- Add element type to the `getIds` method of `Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Element\SearchResult\ElementSearchResult`

#### Interface changes
- Added `PermissionTypes $permissionType` parameter with default type `PermissionTypes::LIST` to
- `AssetSearchServiceInterface::search` method
- `DocumentSearchServiceInterface::search` method
- `DataObjectSearchServiceInterface::search` method
- `ElementSearchServiceInterface::search` method
- Search services `byId` methods now return elements based on the `PermissionTypes::VIEW` permission
- Added type specific interfaces for searches to avoid mixing up different search types in search services
- `AssetSearch` now implements `AssetSearchInterface`
- `DocumentSearch` now implements `DocumentSearchInterface`
- `ElementSearch` now implements `ElementSearchInterface`
- Search services now require the specific search type for the search
- `AssetSearchServiceInterface::search` now requires a `AssetSearchInterface`
- `DocumentSearchServiceInterface::search` now requires a `DocumentSearchInterface`
- `ElementSearchServiceInterface::search` now requires a `ElementSearchInterface`
- `SearchProviderInterface` now returns type specific search interfaces

## 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
Expand All @@ -21,25 +54,4 @@ The new service alias can be used to inject the search client into your services
## Upgrade to 1.1.0
- Execute the following command to reindex all elements to be able to use all new features:

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

## Upgrade to 2.0.0

### BC-Breaks

#### Interface changes
- Added `PermissionTypes $permissionType` parameter with default type `PermissionTypes::LIST` to
- `AssetSearchServiceInterface::search` method
- `DocumentSearchServiceInterface::search` method
- `DataObjectSearchServiceInterface::search` method
- `ElementSearchServiceInterface::search` method
- Search services `byId` methods now return elements based on the `PermissionTypes::VIEW` permission
- Added type specific interfaces for searches to avoid mixing up different search types in search services
- `AssetSearch` now implements `AssetSearchInterface`
- `DocumentSearch` now implements `DocumentSearchInterface`
- `ElementSearch` now implements `ElementSearchInterface`
- Search services now require the specific search type for the search
- `AssetSearchServiceInterface::search` now requires a `AssetSearchInterface`
- `DocumentSearchServiceInterface::search` now requires a `DocumentSearchInterface`
- `ElementSearchServiceInterface::search` now requires a `ElementSearchInterface`
- `SearchProviderInterface` now returns type specific search interfaces
```bin/console generic-data-index:update:index```
28 changes: 0 additions & 28 deletions src/Attribute/OpenSearch/AsSearchModifierHandler.php

This file was deleted.

16 changes: 5 additions & 11 deletions src/DependencyInjection/PimcoreGenericDataIndexExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,14 @@ 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']);
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);

$container->setParameter('generic-data-index.index-prefix', $indexSettings['client_params']['index_prefix']);
$container->setParameter(
'generic-data-index.index-prefix',
$indexSettings['client_params']['index_prefix']
);

$definition = $container->getDefinition(DispatchQueueMessagesHandler::class);
$definition->setArgument('$queueSettings', $indexSettings['queue_settings']);
Expand Down
36 changes: 0 additions & 36 deletions src/Enum/SearchIndex/OpenSearch/AttributeType.php

This file was deleted.

30 changes: 0 additions & 30 deletions src/Enum/SearchIndex/OpenSearch/ConditionType.php

This file was deleted.

27 changes: 0 additions & 27 deletions src/Enum/SearchIndex/OpenSearch/QueryType.php

This file was deleted.

29 changes: 0 additions & 29 deletions src/Enum/SearchIndex/OpenSearch/WildcardFilterMode.php

This file was deleted.

43 changes: 0 additions & 43 deletions src/Exception/OpenSearch/SearchFailedException.php

This file was deleted.

40 changes: 0 additions & 40 deletions src/Model/OpenSearch/Aggregation/Aggregation.php

This file was deleted.

Loading

0 comments on commit 1d9a517

Please sign in to comment.