PHP Class ElasticSearch\Transport\HTTP

Inheritance: extends Base
Show file Open project: nervetattoo/elasticsearch

Protected Properties

Property Type Description
$ch resource curl handler which is needed for reusing existing http connection to the server

Public Methods

Method Description
__construct ( $host = 'localhost', $port = 9200, $timeout = null )
delete ( mixed $id = false, array $options = [] ) : array Flush this index/type combination
deleteByQuery ( mixed $query, array $options = [] ) : array Search
getTimeout ( )
index ( array $document, mixed $id = false, array $options = [] ) : array Index a new document or update it if existing
request ( string | array $path, string $method = "GET", array | boolean $payload = false ) : array Perform a request against the given path/method/payload combination Example: $es->request('/_status');
search ( array | string $query, array $options = [] ) : array Search
setTimeout ( $timeout )
update ( array $partialDocument, mixed $id, array $options = [] ) : array Update a part of a document

Protected Methods

Method Description
call ( string $url, string $method = "GET", array | boolean $payload = null ) : array Perform a http call against an url with an optional payload

Method Details

__construct() public method

public __construct ( $host = 'localhost', $port = 9200, $timeout = null )

call() protected method

Perform a http call against an url with an optional payload
protected call ( string $url, string $method = "GET", array | boolean $payload = null ) : array
$url string
$method string (GET/POST/PUT/DELETE)
$payload array | boolean The document/instructions to pass along
return array

delete() public method

Flush this index/type combination
public delete ( mixed $id = false, array $options = [] ) : array
$id mixed Id of document to delete
$options array Parameters to pass to delete action
return array

deleteByQuery() public method

Search
public deleteByQuery ( mixed $query, array $options = [] ) : array
$query mixed
$options array Parameters to pass to delete action
return array

getTimeout() public method

public getTimeout ( )

index() public method

Index a new document or update it if existing
public index ( array $document, mixed $id = false, array $options = [] ) : array
$document array
$id mixed Optional
$options array
return array

request() public method

Perform a request against the given path/method/payload combination Example: $es->request('/_status');
public request ( string | array $path, string $method = "GET", array | boolean $payload = false ) : array
$path string | array
$method string
$payload array | boolean
return array

setTimeout() public method

public setTimeout ( $timeout )

update() public method

Update a part of a document
public update ( array $partialDocument, mixed $id, array $options = [] ) : array
$partialDocument array
$id mixed
$options array
return array

Property Details

$ch protected property

curl handler which is needed for reusing existing http connection to the server
protected resource $ch
return resource