定制 triadev/laravel-elasticsearch-mapping 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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.

Software license Travis Coveralls CodeCov

Scrutinizer Code Quality Code Coverage Build Status

Latest stable Latest development Monthly installs Total Downloads

Supported laravel versions

Laravel 5.5 Laravel 5.6 Laravel 5.7

Supported elasticsearch versions

Elasticsearch 6.0 Elasticsearch 6.1 Elasticsearch 6.2 Elasticsearch 6.3 Elasticsearch 6.4

Installation

Composer

composer require triadev/laravel-elasticsearch-mapping

Application

The package is registered through the package discovery of laravel and Composer.

https://laravel.com/docs/5.7/packages

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

  1. docker-compose -f docker-compose.yml up
  2. 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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-01-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固