Methods

getType()

getType() : string

must return type for QueryBuilder usage.

Returns

string

match()

match(string  $field = null, mixed  $values = null) : \Elastica\Query\Match

match query.

Parameters

string $field
mixed $values

Returns

\Elastica\Query\Match

common_terms()

common_terms(string  $field, string  $query, float  $cutoffFrequency) : \Elastica\Query\Common

common terms query.

Parameters

string $field
string $query
float $cutoffFrequency

percentage in decimal form (.001 == 0.1%)

Returns

\Elastica\Query\Common

fuzzy()

fuzzy(string  $fieldName = null, string  $value = null) : \Elastica\Query\Fuzzy

fuzzy query.

Parameters

string $fieldName

Field name

string $value

String to search for

Returns

\Elastica\Query\Fuzzy

geo_shape()

geo_shape() 

geo shape query.

has_child()

has_child(string|\Elastica\Query|\Elastica\Query\AbstractQuery  $query, string  $type = null) : \Elastica\Query\HasChild

has child query.

Parameters

string|\Elastica\Query|\Elastica\Query\AbstractQuery $query
string $type

Parent document type

Returns

\Elastica\Query\HasChild

has_parent()

has_parent(string|\Elastica\Query|\Elastica\Query\AbstractQuery  $query, string  $type) : \Elastica\Query\HasParent

has parent query.

Parameters

string|\Elastica\Query|\Elastica\Query\AbstractQuery $query
string $type

Parent document type

Returns

\Elastica\Query\HasParent

ids()

ids(array  $ids = array()) : \Elastica\Query\Ids

ids query.

Parameters

array $ids

Returns

\Elastica\Query\Ids

prefix()

prefix(array  $prefix = array()) : \Elastica\Query\Prefix

prefix query.

Parameters

array $prefix

Prefix array

Returns

\Elastica\Query\Prefix

query_string()

query_string(string  $queryString = '') : \Elastica\Query\QueryString

query string query.

Parameters

string $queryString

OPTIONAL Query string for object

Returns

\Elastica\Query\QueryString

simple_query_string()

simple_query_string(string  $query, array  $fields = array()) : \Elastica\Query\SimpleQueryString

simple_query_string query.

Parameters

string $query
array $fields

Returns

\Elastica\Query\SimpleQueryString

range()

range(string  $fieldName = null, array  $args = array()) : \Elastica\Query\Range

range query.

Parameters

string $fieldName
array $args

Returns

\Elastica\Query\Range

regexp()

regexp(string  $key = '', string  $value = null, float  $boost = 1.0) : \Elastica\Query\Regexp

regexp query.

Parameters

string $key
string $value
float $boost

Returns

\Elastica\Query\Regexp

span_near()

span_near(array  $clauses = array(), integer  $slop = 1, boolean  $inOrder = false) : \Elastica\Query\SpanNear

span near query.

Parameters

array $clauses
integer $slop
boolean $inOrder

Returns

\Elastica\Query\SpanNear

span_or()

span_or(array  $clauses = array()) : \Elastica\Query\SpanOr

span_or query.

Parameters

array $clauses

Returns

\Elastica\Query\SpanOr

span_term()

span_term(array  $term = array()) : \Elastica\Query\SpanTerm

span_term query.

Parameters

array $term

Returns

\Elastica\Query\SpanTerm

term()

term(array  $term = array()) : \Elastica\Query\Term

term query.

Parameters

array $term

Returns

\Elastica\Query\Term

terms()

terms(string  $key = '', array  $terms = array()) : \Elastica\Query\Terms

terms query.

Parameters

string $key
array $terms

Returns

\Elastica\Query\Terms

wildcard()

wildcard(string  $key = '', string  $value = null, float  $boost = 1.0) : \Elastica\Query\Wildcard

wildcard query.

Parameters

string $key

OPTIONAL Wildcard key

string $value

OPTIONAL Wildcard value

float $boost

OPTIONAL Boost value (default = 1)

Returns

\Elastica\Query\Wildcard

geo_distance()

geo_distance(string  $key, array|string  $location, string  $distance) : \Elastica\Query\GeoDistance

geo distance query.

Parameters

string $key
array|string $location
string $distance

Returns

\Elastica\Query\GeoDistance

exists()

exists(string  $field) : \Elastica\Query\Exists

exists query.

Parameters

string $field

Returns

\Elastica\Query\Exists

type()

type(string  $type = null) : \Elastica\Query\Type

type query.

Parameters

string $type

Type name

Returns

\Elastica\Query\Type