Download the PHP package lvinkim/elasticsearch-odm without Composer
On this page you can find all versions of the php package lvinkim/elasticsearch-odm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package elasticsearch-odm
elasticsearch-odm
支持版本
6.0 以上
安装
方法概述
索引管理方法
- 初始化索引: initialIndex()
- 更新索引别名: updateAliases($newIndexName)
- 删除索引: deleteIndex()
文档管理方法
- 通过 ID 获取单个 Entity 的方法:findOneById($id)
- 通过 $query 获取单个 Entity 的方法:findOne($query)
- 通过 $query 获取多个 Entity 的方法:findMany($query, ...)
- 删除单个 Entity 的方法:deleteOne($entity)
- 插入或更新单个 Entity 的方法:upsertOne($entity)
- 插入或更新多个 Entity 的方法:upsertMany($entities)
使用说明:
步骤2. 定义 Repository 类
步骤3. 使用示例
use Lvinkim\ElasticSearchODM\DocumentManager;
use Elasticsearch\ClientBuilder;
$hosts = ['docker.for.mac.localhost:9200'];
$client = ClientBuilder::create()->setHosts($hosts)->build();
$documentManager = new DocumentManager($client);
$userRepository = $documentManager->getRepository(UserRepository::class);
// 创建索引
$userRepository->initialIndex();
// 插入文档
$user = new User();
$user->setAge(18);
$userRepository->insertOne($user);
// 更多方法.... 参见 Functional/RepositoryTest.php 的各用例
All versions of elasticsearch-odm with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.1
doctrine/annotations Version ^1.6
elasticsearch/elasticsearch Version ^6.0
doctrine/annotations Version ^1.6
elasticsearch/elasticsearch Version ^6.0
The package lvinkim/elasticsearch-odm contains the following files
Loading the files please wait ....