Constants

EXTRA_FILTER

EXTRA_FILTER

EXTRA_QUERY

EXTRA_QUERY

EXTRA_SIZE

EXTRA_SIZE

EXTRA_TRACK_SCORES

EXTRA_TRACK_SCORES

EXTRA_SORT

EXTRA_SORT

EXTRA_AGGS

EXTRA_AGGS

EXTRA_HIGHLIGHT

EXTRA_HIGHLIGHT

Properties

$_extraRequestBodyOptions

$_extraRequestBodyOptions : 

Type

Methods

__construct()

__construct(\Elastica\Index  $index) 

Construct new percolator.

Parameters

\Elastica\Index $index

registerQuery()

registerQuery(string  $name, string|\Elastica\Query|\Elastica\Query\AbstractQuery  $query, array  $fields = array()) : \Elastica\Response

Registers a percolator query, with optional extra fields to include in the registered query.

Parameters

string $name

Query name

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

Query to add

array $fields

Extra fields to include in the registered query and can be used to filter executed queries.

Returns

\Elastica\Response

unregisterQuery()

unregisterQuery(string  $name) : \Elastica\Response

Removes a percolator query.

Parameters

string $name

query name

Returns

\Elastica\Response

matchDoc()

matchDoc(\Elastica\Document  $doc, string|\Elastica\Query|\Elastica\Query\AbstractQuery  $query = null, string  $type = 'type', array  $params = array()) : array

Match a document to percolator queries.

Parameters

\Elastica\Document $doc
string|\Elastica\Query|\Elastica\Query\AbstractQuery $query

Query to filter the percolator queries which are executed.

string $type
array $params

Supports setting additional request body options to the percolate request. [ Percolator::EXTRA_FILTER, Percolator::EXTRA_QUERY, Percolator::EXTRA_SIZE, Percolator::EXTRA_TRACK_SCORES, Percolator::EXTRA_SORT, Percolator::EXTRA_AGGS, Percolator::EXTRA_HIGHLIGHT ]

Returns

array —

With matching registered queries.

matchExistingDoc()

matchExistingDoc(string  $id, string  $type, string|\Elastica\Query|\Elastica\Query\AbstractQuery  $query = null, array  $params = array()) : array

Percolating an existing document.

Parameters

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

Query to filter the percolator queries which are executed.

array $params

Supports setting additional request body options to the percolate request. [ Percolator::EXTRA_FILTER, Percolator::EXTRA_QUERY, Percolator::EXTRA_SIZE, Percolator::EXTRA_TRACK_SCORES, Percolator::EXTRA_SORT, Percolator::EXTRA_AGGS, Percolator::EXTRA_HIGHLIGHT ]

Returns

array —

With matching registered queries.

getIndex()

getIndex() : \Elastica\Index

Return index object.

Returns

\Elastica\Index

_applyAdditionalRequestBodyOptions()

_applyAdditionalRequestBodyOptions(  $params,   $data) 

Process the provided parameters and apply them to the data array.

Parameters

$params
$data

_percolate()

_percolate(string  $path,   $query, array  $data = array(), array  $params = array()) : array

Parameters

string $path
$query
array $data
array $params

Returns

array