ovr/phalcon-elasticsearch
最新稳定版本:0.1
Composer 安装命令:
composer require ovr/phalcon-elasticsearch
包简介
README 文档
README
How to use
Create your model
namespace Models; use Ovr\Phalcon\Elastic\ModelTrait; class Project extends Injectable { use ModelTrait; protected static $index = 'phalconist'; protected static $type = 'project'; /** * @param int $limit * @return mixed */ public static function myQuery($limit = 25) { $query = [ 'aggs' => [ 'types' => [ 'terms' => [ 'field' => 'composer.type', 'size' => $limit, ], ] ] ]; $resultSet = static::getStorage()->search($query); return static::toTags($resultSet->getAggregation('types')['buckets'], 'key', 'doc_count'); } }
Use
$result = Project::myQuery(25);
License
This project is open-sourced software licensed under the MIT License. See the LICENSE file for more information.
统计信息
- 总下载量: 2.79k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 29
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-11-14