PHP Class ElasticSearch\Transport\Base

(c) Raymond Julin For the full copyright and license information, please view the LICENSE file that was distributed with this source code.
Exibir arquivo Open project: nervetattoo/elasticsearch Class Usage Examples

Protected Properties

Property Type Description
$host string What host to connect to for server
$index string ElasticSearch index
$port integer Port to connect on
$type string ElasticSearch document type

Public Methods

Method Description
__construct ( string $host, integer $port ) Default constructor, just set host and port
delete ( mixed $id = false ) Delete a document by its id
deleteByQuery ( mixed $query, array $options = [] ) : array Search
index ( array | object $document, mixed $id = false, array $options = [] ) Method for indexing a new document
request ( string | array $path, string $method = "GET", array | boolean $payload = false ) Perform a request against the given path/method/payload combination Example: $es->request('/_status');
search ( array | string $query ) Perform a search based on query
setIndex ( string $index ) Set what index to act against
setType ( string $type ) Set what document types to act against
update ( array | object $partialDocument, mixed $id, array $options = [] ) Method for updating a document

Protected Methods

Method Description
buildUrl ( array | boolean $path = false, array $options = [] ) : string Build a callable url

Method Details

__construct() public method

Default constructor, just set host and port
public __construct ( string $host, integer $port )
$host string
$port integer

buildUrl() protected method

Build a callable url
protected buildUrl ( array | boolean $path = false, array $options = [] ) : string
$path array | boolean
$options array Query parameter options to pass
return string

delete() abstract public method

Delete a document by its id
abstract public delete ( mixed $id = false )
$id mixed

deleteByQuery() public method

Search
public deleteByQuery ( mixed $query, array $options = [] ) : array
$query mixed String or array to use as criteria for delete
$options array Parameters to pass to delete action
return array

index() abstract public method

Method for indexing a new document
abstract public index ( array | object $document, mixed $id = false, array $options = [] )
$document array | object
$id mixed
$options array

request() abstract public method

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

setIndex() public method

Set what index to act against
public setIndex ( string $index )
$index string

setType() public method

Set what document types to act against
public setType ( string $type )
$type string

update() abstract public method

Method for updating a document
abstract public update ( array | object $partialDocument, mixed $id, array $options = [] )
$partialDocument array | object
$id mixed
$options array

Property Details

$host protected_oe property

What host to connect to for server
protected string $host
return string

$index protected_oe property

ElasticSearch index
protected string $index
return string

$port protected_oe property

Port to connect on
protected int $port
return integer

$type protected_oe property

ElasticSearch document type
protected string $type
return string