flc / laravel-elasticsearch
Laravel Elasticsearch 构建类
Installs: 3 748
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: ^7.3|^8.0
- elasticsearch/elasticsearch: ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- laravel/framework: ^5.0|^6.0|^7.0|^8.0|^9.0|^10.0
- mockery/mockery: ^1.0
- phpunit/phpunit: ^9.0|^10.0
README
安装
composer require flc/laravel-elasticsearch
版本矩阵
配置
示例
<?php use Elasticsearch; Elasticsearch::index('users') ->select('id', 'username', 'password', 'created_at', 'updated_at', 'status', 'deleted') ->whereTerm('status', 1) ->orWhereIn('deleted', [1, 2]) ->whereNotExists('area') ->where(['status' => 1, 'closed' => 0]) ->where(function ($query) { $query->where('status', '=', 1) ->where('closed', 1) ->where('username', 'like', '张三'); ->where('username', 'match', '李四'); }) ->orderBy('id', 'desc') ->take(2) ->paginate(10); // ->get(); // ->search();
LICENSE
- MIT
- Anti 996