include/SugarSearchEngine/Elastic/Elastica/Result.php
Elastica result item
Stores all information from a result
- Author
- Nicolas Ruflin
- Category
- Xodoa
- Package
- Elastica
\Elastica_Result
Package: Elastica
Parameters
Returns
Returns
Parameters
Returns
Elastica result item
Stores all information from a result
- Author
- Nicolas Ruflin
- Category
- Xodoa
Properties
Methods

__construct(
array $hit
)
:
voidConstructs a single results object
Parameters
| Name | Type | Description |
|---|---|---|
| $hit | array | Hit data |

__get(
string $key
)
:
mixedMagic function to directly access keys inside the result
Returns null if key does not exist
| Name | Type | Description |
|---|---|---|
| $key | string | Key name |
| Type | Description |
|---|---|
| mixed | Key value |

getData(
)
:
arrayReturns result data
Checks for partial result data with getFields, falls back to getSource
| Type | Description |
|---|---|
| array | Result data array |

getExplanation(
)
:
arrayReturns explanation on how its score was computed.
Returns
| Type | Description |
|---|---|
| array | explanations |

getParam(
string $name
)
:
arrayReturns a param from the result hit array
This function can be used to retriev all data for which not a specific function exists. If the param does not exists and empty array is retured
| Name | Type | Description |
|---|---|---|
| $name | string | Param name |
| Type | Description |
|---|---|
| array | Result data |