webfactory/content-mapping-destinationadapter-solarium-bundle
最新稳定版本:1.11.0
Composer 安装命令:
composer require webfactory/content-mapping-destinationadapter-solarium-bundle
包简介
README 文档
README
Symfony bundle for webfactory/content-mapping-destinationadapter-solarium, easing your synchronization life via simple configuration, a services and a console command.
Installation
Install the package via composer:
composer require webfactory/content-mapping-destinationadapter-solarium-bundle
and register two bundles in your Symfony Kernel:
Webfactory\ContentMappingDestinationAdapterSolariumBundle\WebfactoryContentMappingDestinationAdapterSolariumBundleNelmio\SolariumBundle\NelmioSolariumBundle
Also, configure the endpoint for the Solarium client. Currently, only the default client with the default endpoint is supported.
// app/config.yml nelmio_solarium: endpoints: default: host: localhost port: 8983 core: your-core
Usage
The bundle provides a service called contentmapping.destinationadapter.solarium which you can use to define a
Synchronizer service inside the webfactory/content-mapping mini
framework:
<?php # Resources/config/services.php return static function(ContainerConfigurator $container) { $services = $container->services(); $services->set('my_entity_synchronizer', \Webfactory\ContentMapping\Synchronizer::class) ->args([ inline_service('Webfactory\ContentMapping\SourceAdapter\Doctrine\GenericDoctrineSourceAdapter') ->args([ inline_service('MyVendor\MyBundle\Entity\MyEntityRepository'), 'findForSolrIndex', ]), inline_service('MyVendor\MyBundle\ContentMapping\MyEntityMapper'), service('contentmapping.destinationadapter.solarium'), service('logger'), ]) ->tag('monolog.logger', ['channel' => 'solr']) ->tag('contentmapping.synchronizer', ['objectclass' => 'my-object-class']); // other synchronizers here };
As a bonus, this bundle provides you with a console command for deleting data from the solr index matching a query:
app/bin content-mapping:solarium:delete-from-index [query=*:*]
Credits, Copyright and License
This project was started at webfactory GmbH, Bonn.
Copyright 2015-2025 webfactory GmbH, Bonn. Code released under the MIT license.
统计信息
- 总下载量: 14.05k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-07