addons/elasticsearch
Composer 安装命令:
composer require addons/elasticsearch
包简介
Laravel's elasticsearch Paginator/Collection/Logger Helper.
README 文档
README
An easy way to use the official Elastic Search 5.x~6.x client in your Laravel 5.
Warning: This Manual is for addons/elasticsearch:3.0.0, Elasticsearch 6.x. If you use the Elasticsearch 5.x, Please visit 2.0.1
- Version
- Difference
- Installation and Configuration
- Config
- Usage
- Sync Database to ES
- Logstash Supported
- Copyright and License
Version
- addons/elasticsearch:1.0.2
- Elasticsearch 5.x
- Laravel/Scout 3.0
- Laravel 5.1~5.5
- addons/elasticsearch:2.0.1
- Elasticsearch 5.x
- Laravel/Scout 3.0~4.0
- Laravel 5.1~5.6
- addons/elasticsearch:3.0.0 - master
- Elasticsearch 6.x
- Laravel/Scout 4.0
- Laravel 5.1~5.6
Difference
Elasticsearch 6.0 removes(deprecats) the TYPE. (like database's table)
So We use the ES's index named env('SCOUT_PREFIX').$mode->getTable() for each table
eg:
.env
SCOUT_PREFIX = my_application_name-
Index name like:
my_application_name-users
my_application_name-roles
Example
Search like Laravel's Model
This Builder will search in ES, not Database.
User::search('must')->where('name', 'admin')->whereIn('type', ['1', '2'])->get();
Page
// page 1
User::search()->where(...)->paginate(25);
// page 4
User::search()->where(...)->paginate(25, ['*'], 'page', 4)
Read/Modify the Elastic DSL JSON
User::search('must', function($elasticsearch, &$query){
print_r($query); // Show the DSL JSON
// ... edit the $query.
})->where(...)->get();
Copyright and License
elasticsearch was written by Colin Viebrock, Fly and is released under the MIT License.
Copyright (c) 2016-2018
统计信息
- 总下载量: 2.48k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 46
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-12-09