triadev/laravel-elasticsearch-mapping
Composer 安装命令:
composer require triadev/laravel-elasticsearch-mapping
包简介
A service provider for laravel with a fluent elasticsearch mapping builder.
README 文档
README
A service provider for laravel with a fluent elasticsearch mapping builder.
Supported laravel versions
Supported elasticsearch versions
Installation
Composer
composer require triadev/laravel-elasticsearch-mapping
Application
The package is registered through the package discovery of laravel and Composer.
Configuration
The elasticsearch client is generated via the package: LaravelElasticsearchProvider.
You can find the environment variables for the elasticsearch client in the readme of the package.
Usage
This package offers a fluent mapping builder for elasticsearch. The entry point for each mapping build is a facade.
Triadev\Es\Mapping\Facade\ElasticMapping
Build mapping
use Triadev\Es\Mapping\Facade\ElasticMapping; use Triadev\Es\Mapping\Mapping\Blueprint; ElasticMapping::map(function (Blueprint $blueprint) { // fluent syntax $blueprint->keyword('EXAMPLE')->boost(5); // attributes array syntax $blueprint->keyword('EXAMPLE', [ 'boost' => 5 ]); // settings are used when creating a new index $blueprint->settings([ 'index' => [ 'number_of_replicas' => 10, 'number_of_shards' => 12, 'refresh_interval' => '30s' ] ]); }, INDEX, TYPE);
Create index
If the index does not exist a new index will be created. This also includes the configuration from $blueprint->settings().
Update index
If the index exists an update will be executed.
Reporting Issues
If you do find an issue, please feel free to report it with GitHub's bug tracker for this project.
Alternatively, fork the project and make a pull request. :)
Testing
- docker-compose -f docker-compose.yml up
- composer test
Contributing
Please see CONTRIBUTING for details.
Credits
Other
Project related links
License
The code for laravel-elasticsearch-mapping is distributed under the terms of the MIT license (see LICENSE).
统计信息
- 总下载量: 42
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 3
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-05