PHP Class Wallmander\ElasticsearchIndexer\Service\Elasticsearch

Author: Mikael Mattsson ([email protected])
Show file Open project: wallmanderco/elasticsearch-indexer Class Usage Examples

Protected Properties

Property Type Description
$errorMessage
$isAvailable

Public Methods

Method Description
getErrorMessage ( ) : string Returns a latest saved status message if any.
getIndices ( ) : Guzzle\Http\EntityBodyInterface | string Get a neat list of all indexes as a single string.
getStatus ( ) : boolean | Guzzle\Http\EntityBodyInterface | string Get Elasticsearch status.
httpGet ( $uri ) : Guzzle\Http\Message\Response Send a simple get request to the Elasticsearch server.
httpPost ( $uri, array $data = null ) : Guzzle\Http\Message\Response Send a simple post request to the Elasticsearch server.
httpPut ( $uri, array $data = null ) : Guzzle\Http\Message\Response Send a simple put request to the Elasticsearch server.
indicesExists ( $index ) : boolean | Guzzle\Http\EntityBodyInterface | string Check if Elasticsearch is running and the index exists.
isAvailable ( ) : boolean Evaluate if the we can search for posts.
optimize ( $index = null ) : boolean | Guzzle\Http\EntityBodyInterface | string Optimize the index for searches.
ping ( string $host ) : array Ping a server and get the status and time.
setSettings ( $index, array | object $data ) : boolean | Guzzle\Http\EntityBodyInterface | string

Method Details

getErrorMessage() public static method

Returns a latest saved status message if any.
public static getErrorMessage ( ) : string
return string

getIndices() public static method

Get a neat list of all indexes as a single string.
public static getIndices ( ) : Guzzle\Http\EntityBodyInterface | string
return Guzzle\Http\EntityBodyInterface | string

getStatus() public static method

Get Elasticsearch status.
public static getStatus ( ) : boolean | Guzzle\Http\EntityBodyInterface | string
return boolean | Guzzle\Http\EntityBodyInterface | string

httpGet() public static method

Send a simple get request to the Elasticsearch server.
public static httpGet ( $uri ) : Guzzle\Http\Message\Response
$uri
return Guzzle\Http\Message\Response

httpPost() public static method

Send a simple post request to the Elasticsearch server.
public static httpPost ( $uri, array $data = null ) : Guzzle\Http\Message\Response
$uri
$data array
return Guzzle\Http\Message\Response

httpPut() public static method

Send a simple put request to the Elasticsearch server.
public static httpPut ( $uri, array $data = null ) : Guzzle\Http\Message\Response
$uri
$data array
return Guzzle\Http\Message\Response

indicesExists() public static method

Check if Elasticsearch is running and the index exists.
public static indicesExists ( $index ) : boolean | Guzzle\Http\EntityBodyInterface | string
$index
return boolean | Guzzle\Http\EntityBodyInterface | string

isAvailable() public static method

Evaluate if the we can search for posts.
public static isAvailable ( ) : boolean
return boolean

optimize() public static method

Optimize the index for searches.
public static optimize ( $index = null ) : boolean | Guzzle\Http\EntityBodyInterface | string
$index
return boolean | Guzzle\Http\EntityBodyInterface | string

ping() public static method

Ping a server and get the status and time.
public static ping ( string $host ) : array
$host string
return array

setSettings() public static method

public static setSettings ( $index, array | object $data ) : boolean | Guzzle\Http\EntityBodyInterface | string
$index
$data array | object
return boolean | Guzzle\Http\EntityBodyInterface | string

Property Details

$errorMessage protected static property

protected static $errorMessage

$isAvailable protected static property

protected static $isAvailable