naresh/elasticsearchclient
Composer 安装命令:
composer require naresh/elasticsearchclient
包简介
ElasticSearch client library with amazon elasticsearch PHP signing handler
README 文档
README
ElasticSearch client library with amazon elasticsearch PHP signing handler. This library is targeted for laravel but can also be used with other frameworks.
Installation
Require package in composer.json file.
"require":{
"naresh/elasticsearchclient": "1.0.*",
}
And run composer update to update the dependency.
Configuration (Laravel Only)
NOTE: You do not have to add ServerProvider and Facade if you are using Laravel 5.5 package autodiscovery.
Add the ServiceProvider to the providers array in config/app.php
Naresh\ElasticSearchClient\ServiceProvider::classAdd EsClient Facade in config/app.php
'EsClient' => Naresh\ElasticSearchClient\Facade\EsClient::class,
Usage
You can get the new Elasticsearch instance in two ways
1) With EsClient Facade (Laravel Only)
* `EsClient::getClient($options)`
2) With new instance of Naresh\ElasticSearchClient\ElasticSearchClient
* `new ElasticSearchClient($options)`
$options
[
'hosts' => [],
'aws_host' => false,
'access_key' => '',
'secret_key' => '',
'region' => ''
];
hosts (array)
- Elasticsearch host(s)
aws_host (boolean)
- Boolean flag to specify if the hostname is AWS Elasticsearch service, however if your host has
amazonawsin its URL then you dont have to add this flag, this library will assume it as AWS Elasticsearch service
- Boolean flag to specify if the hostname is AWS Elasticsearch service, however if your host has
access_key(string only needed if host is AWS Elasticsearch service)
- AWS Elasticsearch service access key
secret_key(string only needed if host is AWS Elasticsearch service)
- AWS Elasticsearch service secret key
region(string only needed if host is AWS Elasticsearch service)
- AWS Elasticsearch service region
Run tests
Run unit test with phpunit following command.
vendor/bin/phpunit -v
It will generate test coverage reports in reports folder
统计信息
- 总下载量: 4.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-03-12