shift31/laravel-elasticsearch
Composer 安装命令:
composer require shift31/laravel-elasticsearch
包简介
A Laravel Service Provider for the Elasticsearch API client
README 文档
README
This is a Laravel (4.2) Service Provider for the official Elasticsearch low-level client.
Version Matrix
Since there are breaking changes in Elasticsearch versions, your version of Elasticsearch must match the version of this library, which matches the version of the Elasticsearch low-level client.
| Shift31/laravel-elasticsearch | Elasticsearch | Laravel |
|---|---|---|
| 0.4 | <= 0.90.* | 4.2 |
| 1.0, 2.0 | >= 1.0 | 4.x, 5.x |
| 4.0 | <= 0.90.* | 4.2 |
| 4.1 | >= 1.0 <= 2.0 | 4.2 |
| 4.2 | >= 2.0 <= 5.0 | 4.2 |
| 4.5 | >= 5.0 | 4.2 |
| 5.0 | <= 0.90.* | 5.x |
| 5.1 | >= 1.0 <= 2.0 | 5.x |
| 5.2 | >= 2.0 <= 5.0 | 5.x |
| 5.5 | >= 5.0 | 5.x |
Attention: Until we launch new versions please keep using old stable versions (which are created as a branch) and don't use dev-master branch!
Usage
-
Run
composer require shift31/laravel-elasticsearch:~4.5.0 -
Publish config file
Laravel artisan command
$ php artisan config:publish shift31/laravel-elasticsearch
You can always read config parameters with:
\Config::get('shift31::elasticsearch');
Note: The keys of this array should be named according the parameters supported by Elasticsearch\ClientBuilder.
-
In the
'providers'array in app/config/app.php, add'Shift31\LaravelElasticsearch\ElasticsearchServiceProvider'. -
Use the
Esfacade to access any method from theElasticsearch\Clientclass, for example:
$searchParams['index'] = 'your_index'; $searchParams['size'] = 50; $searchParams['body']['query']['query_string']['query'] = 'foofield:barstring'; $result = Es::search($searchParams);
Default Configuration
If you return an empty array in the config file, Service provider merges default config with custom config variables. For custom config file question please see this elastic search configuration page.
Default config file which is publishing by artisan command.
Contributing
Please see CONTRIBUTING.md.
shift31/laravel-elasticsearch 适用场景与选型建议
shift31/laravel-elasticsearch 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 371.2k 次下载、GitHub Stars 达 193, 最近一次更新时间为 2013 年 10 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 shift31/laravel-elasticsearch 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 shift31/laravel-elasticsearch 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 371.2k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 200
- 点击次数: 6
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2013-10-27