PHP Class Sleimanx2\Plastic\Connection

Afficher le fichier Open project: sleimanx2/plastic Class Usage Examples

Protected Properties

Свойство Type Description
$elastic Elasticsearch\Client Elasticsearch client instance.
$index string Elastic Search default index.

Méthodes publiques

Méthode 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

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

Method Details

__construct() public méthode

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

bulkStatement() public méthode

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

deleteStatement() public méthode

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

existsStatement() public méthode

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

getClient() public méthode

Get the elastic search client instance.
public getClient ( ) : Elasticsearch\Client
Résultat Elasticsearch\Client

getDSLQuery() public méthode

Get DSL grammar instance for this connection.
public getDSLQuery ( ) : DSLGrammar
Résultat DSLGrammar

getDefaultIndex() public méthode

Get the default elastic index.
public getDefaultIndex ( ) : string
Résultat string

getMapBuilder() public méthode

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

getMapGrammar() public méthode

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

indexStatement() public méthode

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

mapStatement() public méthode

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

persist() public méthode

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

searchStatement() public méthode

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

setClient() public méthode

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

setDefaultIndex() public méthode

Set the default index.
public setDefaultIndex ( $index ) : Connection
$index
Résultat Connection

suggest() public méthode

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

suggestStatement() public méthode

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

updateStatement() public méthode

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

Property Details

$elastic protected_oe property

Elasticsearch client instance.
protected Client,Elasticsearch $elastic
Résultat Elasticsearch\Client

$index protected_oe property

Elastic Search default index.
protected string $index
Résultat string