library elastic
Encapsulating ES query statements
xdm/elastic
Encapsulating ES query statements
- Thursday, June 14, 2018
- by markbest
- Repository
- 1 Watchers
- 1 Stars
- 4 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 4 Versions
- 0 % Grown
使用方法
- 1、composer require "xdm/elastic"
- 2、调用方法:
use Xdm\Elastic\Elastic;
//construct set host
$elastic = new Elastic($host);
//set index
$elastic->index($index);
//set type
$elastic->type($type);
//add where conditon filter
$elastic->where(['key' => 'value']);
//add whereIn conditon filter
$elastic->whereIn('key', ['value1', 'value2']);
//add range condition filter
$elastic->range('key', ['gte' => 'value1', 'lte' => 'value2']);
//set size
$elastic->take(100);
//add Aggregation
$elastic->count($field);
$elastic->groupBy($field);
$elastic->sum($field);
$elastic->max($field);
$elastic->min($field);
$elastic->avg($field);
//set order
$elastic->orderBy($field, 'desc');
//send query and get response
$response = $elastic->search();
dev-master
9999999-dev
Encapsulating ES query statements
Sources
Download
MIT
The Requires
by
mafengtao
v0.1
0.1.0.0
Encapsulating ES query statements
Sources
Download
MIT
The Requires
by
mafengtao
dev-develop
dev-develop
Encapsulating ES query statements
Sources
Download
MIT
The Requires
by
mafengtao
v0.2
0.2.0.0
Encapsulating ES query statements
Sources
Download
MIT
The Requires
by
mafengtao