PHP Класс Elastica\Aggregation\TopHits

Наследование: extends AbstractAggregation
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
addScriptField ( string $name, Elastica\Script\AbstractScript $script ) Adds a Script to the aggregation.
setExplain ( boolean $explain ) Enables explanation for each hit on how its score was computed.
setFieldDataFields ( array $fields ) Allows to return the field data representation of a field for each hit.
setFrom ( integer $from ) The offset from the first result you want to fetch.
setHighlight ( array $highlightArgs ) Sets highlight arguments for the results.
setScriptFields ( array | ScriptFields $scriptFields ) Set script fields.
setSize ( integer $size ) The maximum number of top matching hits to return per bucket. By default the top three matching hits are returned.
setSort ( array $sortArgs ) How the top matching hits should be sorted. By default the hits are sorted by the score of the main query.
setSource ( array | boolean $params ) Allows to control how the _source field is returned with every hit.
setVersion ( boolean $version ) Returns a version for each search hit.
toArray ( ) : array

Описание методов

addScriptField() публичный Метод

Adds a Script to the aggregation.
public addScriptField ( string $name, Elastica\Script\AbstractScript $script )
$name string
$script Elastica\Script\AbstractScript

setExplain() публичный Метод

Enables explanation for each hit on how its score was computed.
public setExplain ( boolean $explain )
$explain boolean

setFieldDataFields() публичный Метод

Allows to return the field data representation of a field for each hit.
public setFieldDataFields ( array $fields )
$fields array

setFrom() публичный Метод

The offset from the first result you want to fetch.
public setFrom ( integer $from )
$from integer

setHighlight() публичный Метод

Sets highlight arguments for the results.
public setHighlight ( array $highlightArgs )
$highlightArgs array

setScriptFields() публичный Метод

Set script fields.
public setScriptFields ( array | ScriptFields $scriptFields )
$scriptFields array | Elastica\Script\ScriptFields

setSize() публичный Метод

The maximum number of top matching hits to return per bucket. By default the top three matching hits are returned.
public setSize ( integer $size )
$size integer

setSort() публичный Метод

How the top matching hits should be sorted. By default the hits are sorted by the score of the main query.
public setSort ( array $sortArgs )
$sortArgs array

setSource() публичный Метод

Allows to control how the _source field is returned with every hit.
public setSource ( array | boolean $params )
$params array | boolean Fields to be returned or false to disable source

setVersion() публичный Метод

Returns a version for each search hit.
public setVersion ( boolean $version )
$version boolean

toArray() публичный Метод

public toArray ( ) : array
Результат array