PHP Class Elastica\ResultSet

List of all hits that are returned for a search on elasticsearch Result set implements iterator
Author: Nicolas Ruflin ([email protected])
Inheritance: implements Iterator, implements Countable, implements ArrayAccess
Afficher le fichier Open project: ruflin/elastica Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( Response $response, Query $query, Result[] $results ) Constructs ResultSet object.
count ( ) : integer Returns size of current set.
countSuggests ( ) : integer Returns size of current suggests.
current ( ) : Result | boolean Returns the current object of the set.
getAggregation ( string $name ) : array Retrieve a specific aggregation from this result set.
getAggregations ( ) : array Returns all aggregation results.
getDocuments ( ) : array Returns all Documents.
getMaxScore ( ) : float Returns the max score of the results found.
getQuery ( ) : Query
getResponse ( ) : Response Returns response object.
getResults ( ) : Result[] Returns all results.
getSuggests ( ) : array Return all suggests.
getTotalHits ( ) : integer Returns the total number of found hits.
getTotalTime ( ) : integer Returns the total number of ms for this search to complete.
hasAggregations ( ) : boolean Returns whether aggregations exist.
hasSuggests ( ) : boolean Returns true if the response contains suggestion results; false otherwise.
hasTimedOut ( ) : boolean Returns true if the query has timed out.
key ( ) : integer Returns the position of the current entry.
next ( ) Sets pointer (current) to the next item of the set.
offsetExists ( integer $offset ) : boolean Whether a offset exists.
offsetGet ( integer $offset ) : Result | null Offset to retrieve.
offsetSet ( integer $offset, Result $value ) Offset to set.
offsetUnset ( integer $offset ) Offset to unset.
rewind ( ) Resets position to 0, restarts iterator.
valid ( ) : boolean Check if an object exists at the current position.

Method Details

__construct() public méthode

Constructs ResultSet object.
public __construct ( Response $response, Query $query, Result[] $results )
$response Response Response object
$query Query Query object
$results Result[]

count() public méthode

Returns size of current set.
public count ( ) : integer
Résultat integer Size of set

countSuggests() public méthode

Returns size of current suggests.
public countSuggests ( ) : integer
Résultat integer Size of suggests

current() public méthode

Returns the current object of the set.
public current ( ) : Result | boolean
Résultat Result | boolean Set object or false if not valid (no more entries)

getAggregation() public méthode

Retrieve a specific aggregation from this result set.
public getAggregation ( string $name ) : array
$name string the name of the desired aggregation
Résultat array

getAggregations() public méthode

Returns all aggregation results.
public getAggregations ( ) : array
Résultat array

getDocuments() public méthode

Returns all Documents.
public getDocuments ( ) : array
Résultat array Documents \Elastica\Document

getMaxScore() public méthode

Returns the max score of the results found.
public getMaxScore ( ) : float
Résultat float Max Score

getQuery() public méthode

public getQuery ( ) : Query
Résultat Query

getResponse() public méthode

Returns response object.
public getResponse ( ) : Response
Résultat Response Response object

getResults() public méthode

Returns all results.
public getResults ( ) : Result[]
Résultat Result[] Results

getSuggests() public méthode

Return all suggests.
public getSuggests ( ) : array
Résultat array suggest results

getTotalHits() public méthode

Returns the total number of found hits.
public getTotalHits ( ) : integer
Résultat integer Total hits

getTotalTime() public méthode

Returns the total number of ms for this search to complete.
public getTotalTime ( ) : integer
Résultat integer Total time

hasAggregations() public méthode

Returns whether aggregations exist.
public hasAggregations ( ) : boolean
Résultat boolean Aggregation existence

hasSuggests() public méthode

Returns true if the response contains suggestion results; false otherwise.
public hasSuggests ( ) : boolean
Résultat boolean

hasTimedOut() public méthode

Returns true if the query has timed out.
public hasTimedOut ( ) : boolean
Résultat boolean Timed out

key() public méthode

Returns the position of the current entry.
public key ( ) : integer
Résultat integer Current position

next() public méthode

Sets pointer (current) to the next item of the set.
public next ( )

offsetExists() public méthode

Whether a offset exists.
public offsetExists ( integer $offset ) : boolean
$offset integer
Résultat boolean true on success or false on failure.

offsetGet() public méthode

Offset to retrieve.
public offsetGet ( integer $offset ) : Result | null
$offset integer
Résultat Result | null

offsetSet() public méthode

Offset to set.
public offsetSet ( integer $offset, Result $value )
$offset integer
$value Result

offsetUnset() public méthode

Offset to unset.
public offsetUnset ( integer $offset )
$offset integer

rewind() public méthode

Resets position to 0, restarts iterator.
public rewind ( )

valid() public méthode

Check if an object exists at the current position.
public valid ( ) : boolean
Résultat boolean True if object exists