h69 / content-mapping-adapter-elasticsearch
This package is abandoned and no longer maintained.
No replacement package was suggested.
Adapter for the elasticsearch-php client inside the h69/content-mapping mini framework.
1.0.0
2016-09-03 15:37 UTC
Requires
- php: >=5.3.0
- elasticsearch/elasticsearch: ~2.0
- h69/content-mapping: ^4.0
Requires (Dev)
- phpunit/phpunit: ~4.0
- satooshi/php-coveralls: ~0.6
This package is auto-updated.
Last update: 2023-01-21 16:04:27 UTC
README
Adapter for the elasticsearch-php client inside the h69/content-mapping mini framework.
Installation
composer require h69/content-mapping-adapter-elasticsearch
Usage
use Elasticsearch\ClientBuilder; use H69\ContentMapping\Synchronizer; use H69\ContentMapping\Elasticsearch\Adapter as ElasticsearchAdapter; $elasticsearchClient = ClientBuilder::create()->build(); $elasticsearchIndex = 'myIndex'; $sourceAdapter = ...; $destinationAdapter = new ElasticsearchAdapter($elasticsearchClient, $elasticsearchIndex); $typeToSynchronize = 'pages'; $synchronizer = new Synchronizer($sourceAdapter, $destinationAdapter); $synchronizer->synchronize($typeToSynchronize, function($objectA, $objectB){ ... //return Result::unchanged(); return Result::changed($updatedObjectB); });
Credits, Copyright and License
This project/copy was started and developed by h69 Copyright 2016. Code released under the MIT license.