2017 © Pedro Peláez
 

library elastic

Encapsulating ES query statements

image

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

The README.md

使用方法

  • 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();

The Versions

14/06 2018

dev-master

9999999-dev

Encapsulating ES query statements

  Sources   Download

MIT

The Requires

 

by mafengtao

14/09 2017

v0.1

0.1.0.0

Encapsulating ES query statements

  Sources   Download

MIT

The Requires

 

by mafengtao

14/09 2017

dev-develop

dev-develop

Encapsulating ES query statements

  Sources   Download

MIT

The Requires

 

by mafengtao

14/09 2017

v0.2

0.2.0.0

Encapsulating ES query statements

  Sources   Download

MIT

The Requires

 

by mafengtao