Skip to content

Commit

Permalink
fix(symfony): autoconfigure elasticsearch extension (#5376)
Browse files Browse the repository at this point in the history
fixes #5363
  • Loading branch information
soyuka authored Jan 26, 2023
1 parent 99e2c9e commit b15a97d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ parameters:
- src/Core/Bridge/Elasticsearch/DataProvider/Paginator.php
- src/Core/Bridge/Elasticsearch/Exception/IndexNotFoundException.php
- src/Core/Bridge/Elasticsearch/Exception/NonUniqueIdentifierException.php
- src/Core/Bridge/Elasticsearch/Extension/RequestBodySearchCollectionExtensionInterface.php
- src/Core/Bridge/Elasticsearch/Metadata/Document/DocumentMetadata.php
- src/Core/Bridge/Elasticsearch/Metadata/Document/Factory/AttributeDocumentMetadataFactory.php
- src/Core/Bridge/Elasticsearch/Metadata/Document/Factory/CachedDocumentMetadataFactory.php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use ApiPlatform\Api\UrlGeneratorInterface;
use ApiPlatform\Core\Annotation\ApiResource as ApiResourceAnnotation;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\AbstractContextAwareFilter as DoctrineOrmAbstractContextAwareFilter;
use ApiPlatform\Core\Bridge\Elasticsearch\Extension\RequestBodySearchCollectionExtensionInterface as LegacyRequestBodySearchCollectionExtensionInterface;
use ApiPlatform\Core\DataPersister\DataPersisterInterface;
use ApiPlatform\Core\DataProvider\CollectionDataProviderInterface;
use ApiPlatform\Core\DataProvider\ItemDataProviderInterface;
Expand Down Expand Up @@ -915,6 +916,9 @@ private function registerElasticsearchConfiguration(ContainerBuilder $container,
$container->registerForAutoconfiguration(RequestBodySearchCollectionExtensionInterface::class)
->addTag('api_platform.elasticsearch.request_body_search_extension.collection');

$container->registerForAutoconfiguration(LegacyRequestBodySearchCollectionExtensionInterface::class)
->addTag('api_platform.elasticsearch.request_body_search_extension.collection');

$container->setParameter('api_platform.elasticsearch.hosts', $config['elasticsearch']['hosts']);
$container->setParameter('api_platform.elasticsearch.mapping', $config['elasticsearch']['mapping']);
}
Expand Down

0 comments on commit b15a97d

Please sign in to comment.