PHP Class Isswp101\Persimmon\QueryBuilder\QueryBuilder

Datei anzeigen Open project: isswp101/elasticsearch-eloquent Class Usage Examples

Protected Properties

Property Type Description
$query array Query.

Public Methods

Method Description
__construct ( array $body = [] ) Constructor.
__toString ( ) : string
aggregation ( Aggregation $aggregation )
between ( $field, $start, $end )
betweenOrEquals ( $field, $start, $end )
build ( ) : array Build query.
fields ( mixed $fields = false ) Set _source to search query.
filter ( Filter | array $filter = [], string $mode = Filter::MODE_INCLUDE )
from ( integer $from )
getOnlyIds ( ) Return only _id.
greaterThan ( $field, $start )
greaterThanOrEquals ( $field, $start )
gt ( $field, $start )
gte ( $field, $start )
hasSort ( ) : boolean
lessThan ( $field, $end )
lessThanOrEquals ( $field, $end )
lt ( $field, $start )
lte ( $field, $start )
match ( $field, $value )
notMatch ( $field, $value )
notWhere ( $field, $value )
orMatch ( $field, $value )
orWhere ( $field, $value )
range ( $field, $start, $end )
size ( integer $size )
sort ( array | string $sort )
toJson ( integer $options ) : string
where ( $field, $value )

Protected Methods

Method Description
getQuery ( ) : array Return query.
merge ( array $query, $mode = 'must' )

Method Details

__construct() public method

Constructor.
public __construct ( array $body = [] )
$body array

__toString() public method

public __toString ( ) : string
return string

aggregation() public method

public aggregation ( Aggregation $aggregation )
$aggregation Isswp101\Persimmon\QueryBuilder\Aggregations\Aggregation

between() public method

public between ( $field, $start, $end )

betweenOrEquals() public method

public betweenOrEquals ( $field, $start, $end )

build() public method

Build query.
public build ( ) : array
return array

fields() public method

Set _source to search query.
public fields ( mixed $fields = false )
$fields mixed

filter() public method

public filter ( Filter | array $filter = [], string $mode = Filter::MODE_INCLUDE )
$filter Isswp101\Persimmon\QueryBuilder\Filters\Filter | array
$mode string

from() public method

public from ( integer $from )
$from integer

getOnlyIds() public method

Return only _id.
public getOnlyIds ( )

getQuery() protected method

Return query.
protected getQuery ( ) : array
return array

greaterThan() public method

public greaterThan ( $field, $start )

greaterThanOrEquals() public method

public greaterThanOrEquals ( $field, $start )

gt() public method

public gt ( $field, $start )

gte() public method

public gte ( $field, $start )

hasSort() public method

public hasSort ( ) : boolean
return boolean

lessThan() public method

public lessThan ( $field, $end )

lessThanOrEquals() public method

public lessThanOrEquals ( $field, $end )

lt() public method

public lt ( $field, $start )

lte() public method

public lte ( $field, $start )

match() public method

public match ( $field, $value )

merge() protected method

protected merge ( array $query, $mode = 'must' )
$query array

notMatch() public method

public notMatch ( $field, $value )

notWhere() public method

public notWhere ( $field, $value )

orMatch() public method

public orMatch ( $field, $value )

orWhere() public method

public orWhere ( $field, $value )

range() public method

public range ( $field, $start, $end )

size() public method

public size ( integer $size )
$size integer

sort() public method

public sort ( array | string $sort )
$sort array | string

toJson() public method

public toJson ( integer $options ) : string
$options integer
return string

where() public method

public where ( $field, $value )

Property Details

$query protected_oe property

Query.
protected array $query
return array