PHP Class Sleimanx2\Plastic\Connection

ファイルを表示 Open project: sleimanx2/plastic Class Usage Examples

Protected Properties

Property Type Description
$elastic Elasticsearch\Client Elasticsearch client instance.
$index string Elastic Search default index.

Public Methods

Method Description
__construct ( array $config = [] ) Connection constructor.
bulkStatement ( array $params ) : array Execute a bulk statement on index;.
deleteStatement ( array $params ) : array Execute a update statement on index;.
existsStatement ( array $params ) : array | boolean Execute a exists statement on index.
getClient ( ) : Elasticsearch\Client Get the elastic search client instance.
getDSLQuery ( ) : DSLGrammar Get DSL grammar instance for this connection.
getDefaultIndex ( ) : string Get the default elastic index.
getMapBuilder ( ) : Builder Get map builder instance for this connection.
getMapGrammar ( ) : Builder Get map grammar instance for this connection.
indexStatement ( array $params ) : array Execute a insert statement on index;.
mapStatement ( array $mappings ) : array Execute a map statement on index;.
persist ( ) : EloquentPersistence Create a new elastic persistence handler.
search ( ) : SearchBuilder Begin a fluent search query builder.
searchStatement ( array $search ) : array Execute a map statement on index;.
setClient ( Elasticsearch\Client $client ) Set a custom elastic client.
setDefaultIndex ( $index ) : Connection Set the default index.
suggest ( ) : SuggestionBuilder Begin a fluent suggest query builder.
suggestStatement ( array $suggestions ) : array Execute a map statement on index;.
updateStatement ( array $params ) : array Execute a update statement on index;.

Private Methods

Method Description
buildClient ( array $config ) : Elasticsearch\Client Create an elastic search instance.
setStatementIndex ( array $params ) : array

Method Details

__construct() public method

Connection constructor.
public __construct ( array $config = [] )
$config array

bulkStatement() public method

Execute a bulk statement on index;.
public bulkStatement ( array $params ) : array
$params array
return array

deleteStatement() public method

Execute a update statement on index;.
public deleteStatement ( array $params ) : array
$params array
return array

existsStatement() public method

Execute a exists statement on index.
public existsStatement ( array $params ) : array | boolean
$params array
return array | boolean

getClient() public method

Get the elastic search client instance.
public getClient ( ) : Elasticsearch\Client
return Elasticsearch\Client

getDSLQuery() public method

Get DSL grammar instance for this connection.
public getDSLQuery ( ) : DSLGrammar
return DSLGrammar

getDefaultIndex() public method

Get the default elastic index.
public getDefaultIndex ( ) : string
return string

getMapBuilder() public method

Get map builder instance for this connection.
public getMapBuilder ( ) : Builder
return Sleimanx2\Plastic\Map\Builder

getMapGrammar() public method

Get map grammar instance for this connection.
public getMapGrammar ( ) : Builder
return Sleimanx2\Plastic\Map\Builder

indexStatement() public method

Execute a insert statement on index;.
public indexStatement ( array $params ) : array
$params array
return array

mapStatement() public method

Execute a map statement on index;.
public mapStatement ( array $mappings ) : array
$mappings array
return array

persist() public method

Create a new elastic persistence handler.
public persist ( ) : EloquentPersistence
return Sleimanx2\Plastic\Persistence\EloquentPersistence

searchStatement() public method

Execute a map statement on index;.
public searchStatement ( array $search ) : array
$search array
return array

setClient() public method

Set a custom elastic client.
public setClient ( Elasticsearch\Client $client )
$client Elasticsearch\Client

setDefaultIndex() public method

Set the default index.
public setDefaultIndex ( $index ) : Connection
$index
return Connection

suggest() public method

Begin a fluent suggest query builder.
public suggest ( ) : SuggestionBuilder
return Sleimanx2\Plastic\DSL\SuggestionBuilder

suggestStatement() public method

Execute a map statement on index;.
public suggestStatement ( array $suggestions ) : array
$suggestions array
return array

updateStatement() public method

Execute a update statement on index;.
public updateStatement ( array $params ) : array
$params array
return array

Property Details

$elastic protected_oe property

Elasticsearch client instance.
protected Client,Elasticsearch $elastic
return Elasticsearch\Client

$index protected_oe property

Elastic Search default index.
protected string $index
return string