PHP Класс Elastica\Result

Stores all information from a result
Автор: Nicolas Ruflin ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_hit Hit array.

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

Метод Описание
__construct ( array $hit ) Constructs a single results object.
__get ( string $key ) : mixed Magic function to directly access keys inside the result.
__isset ( string $key ) : boolean Magic function to support isset() calls.
getData ( ) : array Returns result data.
getDocument ( ) : Document Returns Document.
getExplanation ( ) : array Returns explanation on how its score was computed.
getFields ( ) : array Returns list of fields.
getHighlights ( ) : array Returns result data.
getHit ( ) : array Returns the raw hit array.
getId ( ) : string Returns the hit id.
getIndex ( ) : string Returns the index name of the result.
getInnerHits ( ) : array Returns inner hits.
getParam ( string $name ) : mixed Returns a param from the result hit array.
getScore ( ) : float Returns the score of the result.
getSource ( ) : array Returns the result source.
getType ( ) : string Returns the type of the result.
getVersion ( ) : string | integer Returns the version information from the hit.
hasFields ( ) : boolean Returns whether result has fields.
hasInnerHits ( ) : boolean Returns whether result has inner hits.
hasParam ( string $name ) : boolean Test if a param from the result hit is set.
setParam ( string $param, mixed $value ) Sets a parameter on the hit.

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

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

Constructs a single results object.
public __construct ( array $hit )
$hit array Hit data

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

Returns null if key does not exist
public __get ( string $key ) : mixed
$key string Key name
Результат mixed Key value

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

Magic function to support isset() calls.
public __isset ( string $key ) : boolean
$key string Key name
Результат boolean

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

Checks for partial result data with getFields, falls back to getSource or both
public getData ( ) : array
Результат array Result data array

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

Returns Document.
public getDocument ( ) : Document
Результат Document

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

Returns explanation on how its score was computed.
public getExplanation ( ) : array
Результат array explanations

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

Returns list of fields.
public getFields ( ) : array
Результат array Fields list

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

Returns result data.
public getHighlights ( ) : array
Результат array Result data array

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

Returns the raw hit array.
public getHit ( ) : array
Результат array Hit array

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

Returns the hit id.
public getId ( ) : string
Результат string Hit id

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

Returns the index name of the result.
public getIndex ( ) : string
Результат string Index name

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

Returns inner hits.
public getInnerHits ( ) : array
Результат array Fields list

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

This function can be used to retrieve all data for which a specific function doesn't exist. If the param does not exist, an empty array is returned
public getParam ( string $name ) : mixed
$name string Param name
Результат mixed Result data

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

Returns the score of the result.
public getScore ( ) : float
Результат float Result score

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

Returns the result source.
public getSource ( ) : array
Результат array Source data array

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

Returns the type of the result.
public getType ( ) : string
Результат string Result type

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

Returns the version information from the hit.
public getVersion ( ) : string | integer
Результат string | integer Document version

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

Returns whether result has fields.
public hasFields ( ) : boolean
Результат boolean

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

Returns whether result has inner hits.
public hasInnerHits ( ) : boolean
Результат boolean

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

Test if a param from the result hit is set.
public hasParam ( string $name ) : boolean
$name string Param name to test
Результат boolean True if the param is set, false otherwise

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

Sets a parameter on the hit.
public setParam ( string $param, mixed $value )
$param string
$value mixed

Описание свойств

$_hit защищенное свойство

Hit array.
protected $_hit