PHP Class Elastica\Search

Author: Nicolas Ruflin ([email protected])
Afficher le fichier Open project: ruflin/elastica Class Usage Examples

Protected Properties

Свойство Type Description
$_client Client Client object.
$_indices array Array of indices.
$_options array
$_query Query
$_types array Array of types.

Méthodes publiques

Méthode Description
__construct ( Client $client, Elastica\ResultSet\BuilderInterface $builder = null ) Constructs search object.
addIndex ( Index | string $index ) Adds a index to the list.
addIndices ( array $indices = [] ) Add array of indices at once.
addOption ( string $key, mixed $value )
addType ( Type | string $type ) Adds a type to the current search.
addTypes ( array $types = [] ) Add array of types.
clearOptions ( )
count ( mixed $query = '', $fullResult = false ) : integer | ResultSet
create ( elastica\SearchableInterface $searchObject ) : Search Creates new search object.
getClient ( ) : Client Return client object.
getIndices ( ) : array Return array of indices.
getOption ( string $key ) : mixed
getOptions ( ) : array
getPath ( ) : string Combines indices and types to the search request path.
getQuery ( ) : Query
getResultSetBuilder ( ) : Elastica\ResultSet\BuilderInterface
getTypes ( ) : array Return array of types.
hasIndex ( Index | string $index ) : boolean
hasIndices ( ) : boolean
hasOption ( string $key ) : boolean
hasType ( Type | string $type ) : boolean
hasTypes ( ) : boolean
scroll ( string $expiryTime = '1m' ) : Scroll Returns the Scroll Iterator.
search ( mixed $query = '', integer | array $options = null ) : ResultSet Search in the set indices, types.
setOption ( string $key, mixed $value )
setOptions ( array $options )
setOptionsAndQuery ( array | integer $options = null, string | array | Query $query = '' )
setQuery ( string | array | Query | Elastica\Suggest | Elastica\Query\AbstractQuery $query )
setSuggest ( elastica\Suggest $suggest )

Méthodes protégées

Méthode Description
_validateOption ( string $key ) : boolean

Method Details

__construct() public méthode

Constructs search object.
public __construct ( Client $client, Elastica\ResultSet\BuilderInterface $builder = null )
$client Client Client object
$builder Elastica\ResultSet\BuilderInterface

_validateOption() protected méthode

protected _validateOption ( string $key ) : boolean
$key string
Résultat boolean

addIndex() public méthode

Adds a index to the list.
public addIndex ( Index | string $index )
$index Index | string Index object or string

addIndices() public méthode

Add array of indices at once.
public addIndices ( array $indices = [] )
$indices array

addOption() public méthode

public addOption ( string $key, mixed $value )
$key string
$value mixed

addType() public méthode

Adds a type to the current search.
public addType ( Type | string $type )
$type Type | string Type name or object

addTypes() public méthode

Add array of types.
public addTypes ( array $types = [] )
$types array

clearOptions() public méthode

public clearOptions ( )

count() public méthode

public count ( mixed $query = '', $fullResult = false ) : integer | ResultSet
$query mixed
$fullResult (default = false) By default only the total hit count is returned. If set to true, the full ResultSet including aggregations is returned
Résultat integer | ResultSet

create() public static méthode

Creates new search object.
public static create ( elastica\SearchableInterface $searchObject ) : Search
$searchObject elastica\SearchableInterface
Résultat Search

getClient() public méthode

Return client object.
public getClient ( ) : Client
Résultat Client Client object

getIndices() public méthode

Return array of indices.
public getIndices ( ) : array
Résultat array List of index names

getOption() public méthode

public getOption ( string $key ) : mixed
$key string
Résultat mixed

getOptions() public méthode

public getOptions ( ) : array
Résultat array

getPath() public méthode

Combines indices and types to the search request path.
public getPath ( ) : string
Résultat string Search path

getQuery() public méthode

public getQuery ( ) : Query
Résultat Query

getResultSetBuilder() public méthode

public getResultSetBuilder ( ) : Elastica\ResultSet\BuilderInterface
Résultat Elastica\ResultSet\BuilderInterface

getTypes() public méthode

Return array of types.
public getTypes ( ) : array
Résultat array List of types

hasIndex() public méthode

public hasIndex ( Index | string $index ) : boolean
$index Index | string
Résultat boolean

hasIndices() public méthode

public hasIndices ( ) : boolean
Résultat boolean

hasOption() public méthode

public hasOption ( string $key ) : boolean
$key string
Résultat boolean

hasType() public méthode

public hasType ( Type | string $type ) : boolean
$type Type | string
Résultat boolean

hasTypes() public méthode

public hasTypes ( ) : boolean
Résultat boolean

scroll() public méthode

Returns the Scroll Iterator.
See also: Elastica\Scroll
public scroll ( string $expiryTime = '1m' ) : Scroll
$expiryTime string
Résultat Scroll

setOption() public méthode

public setOption ( string $key, mixed $value )
$key string
$value mixed

setOptions() public méthode

public setOptions ( array $options )
$options array

setOptionsAndQuery() public méthode

public setOptionsAndQuery ( array | integer $options = null, string | array | Query $query = '' )
$options array | integer
$query string | array | Query

setQuery() public méthode

public setQuery ( string | array | Query | Elastica\Suggest | Elastica\Query\AbstractQuery $query )
$query string | array | Query | Elastica\Suggest | Elastica\Query\AbstractQuery

setSuggest() public méthode

public setSuggest ( elastica\Suggest $suggest )
$suggest elastica\Suggest

Property Details

$_client protected_oe property

Client object.
protected Client,Elastica $_client
Résultat Client

$_indices protected_oe property

Array of indices.
protected array $_indices
Résultat array

$_options protected_oe property

protected array $_options
Résultat array

$_query protected_oe property

protected Query,Elastica $_query
Résultat Query

$_types protected_oe property

Array of types.
protected array $_types
Résultat array