forked from roaatech/php-es-mapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
QueryBuilder.php
31 lines (23 loc) · 988 Bytes
/
QueryBuilder.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
require '../vendor/autoload.php';
$builder = \ItvisionSy\EsMapper\QueryBuilder::make();
/* @var $builder \ItvisionSy\EsMapper\QueryBuilder */
var_dump($builder->toJSON());
$builder->emptyQuery();
$builder->term("name", "Muhannad Shelleh");
var_dump($builder->toJSON());
$builder->emptyQuery();
$builder->term(["name", "email"], "Muhannad Shelleh");
var_dump($builder->toJSON());
$builder->emptyQuery();
$builder->term(["name", "email"], ["Muhannad", "Shelleh"]);
var_dump($builder->toJSON());
$builder->emptyQuery();
$builder->orWhere()->where("name", "Shehab", "*")->where("email", "mhh1422", "*")->endSubQuery();
var_dump($builder->toJSON());
$builder->emptyQuery();
$builder->orWhere()->where("name", "Muhannad Shelleh")->where("email", "[email protected]")->endSubQuery();
var_dump($builder->toJSON());
$builder->emptyQuery();
$builder->orWhere()->where("name", "Muhannad", "=*")->where("email", "*hotmail*", "*=*")->endSubQuery();
var_dump($builder->toJSON());