cmsig/seal-read-write-adapter
最新稳定版本:0.12.6
Composer 安装命令:
composer require cmsig/seal-read-write-adapter
包简介
An adapter to support to split read and write operations for the cmsig/seal package.
README 文档
README
Note: This is part of the
cmsig/searchproject create issues in the main repository.
SEAL
Read Write Adapter
The ReadWriteAdapter allows to use one adapter instance for reading
and one for writing. This is useful if you want to reindex something
without a downtime.
Note: This project is heavily under development and any feedback is greatly appreciated.
Installation
Use composer for install the package:
composer require cmsig/seal cmsig/seal-read-write-adapter
Usage
To use the adapter an instance of ReadWriteAdapter need to be created
which get a $readAdapter and $writeAdapter which are instances of the
AdapterInterface.
The following code shows how to create an Engine using this Adapter:
<?php use CmsIg\Seal\Adapter\Elasticsearch\ElasticsearchAdapter; use CmsIg\Seal\Adapter\ReadWrite\ReadWriteAdapter; use CmsIg\Seal\Engine; $readAdapter = new ElasticsearchAdapter(/* .. */); // can be any adapter $writeAdapter = new ElasticsearchAdapter(/* .. */); // can be any adapter $engine = new Engine( new ReadWriteAdapter( $readAdapter, $writeAdapter ), $schema, );
Via DSN for your favorite framework:
multi://readAdapter?adapters[]=writeAdapter read-write://readAdapter?write=multiAdapter
Note Read a document and partial update it based on the read document should be avoided when using this adapter, as the read document could already be outdated. So always fully update the document and never do based on read documents. Have a look at the
MultiAdapterto write into read and write adapter.
Authors
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 10
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2024-11-16