chaospower/laravel-elastic-indexer

Laravel Elastic Eloquent 查询构建器

dev-master 2016-01-06 07:48 UTC

This package is not auto-updated.

Last update: 2024-09-28 18:58:36 UTC


README

此包目前处于开发阶段。使用风险自担。

Laravel Elastic Indexer

待办:包简介

要求

  • PHP 5.5
  • PHP 5.6
  • ElasticSearch 1.7
  • ElasticSearch 2.0
  • Laravel 5.1

特性

  • 自动索引

安装

composer require chaospower/laravel-elastic-indexer

前往你的项目根目录,其中包含 artisan.php。然后发布供应商包

php artisan vendor:publish

编辑你的 config/app.php 并添加提供者

ElasticEqb\Providers\ElasticProvider::class

使用 Elastic Indexer

所有模型都应该使用并实现 DoesElasticIndexer。这样做将允许服务监听特定的模型,并CRUD模型的Elastic侧。它还将自动执行Elastic映射。

/**
 * Class Agency
 *
 * @package Travel\Models
 */
class Agency extends Model implements ElasticIndexer
{
    use DoesElasticIndexer;
}

里程碑

  • ElasticBuilder
  • ElasticSchemaBuilder

待办事项

给予监听所有没有 DoesElasticIndexer 实例的模型的能力

计划

将包转换为 Laravel 数据库