PHP Trait Sleimanx2\Plastic\Searchable

Show file Open project: sleimanx2/plastic

Public Properties

Property Type Description
$documentScore null | integer Hit score after querying Elasticsearch.
$documentVersion null | integer Elasticsearch document version.
$isDocument boolean Is indexed in elastic search.

Public Methods

Method Description
__call ( string $method, array $parameters ) : mixed Handle dynamic method calls into the model.
bootSearchable ( ) Searchable boot model.
document ( ) : EloquentPersistence Start an elastic persistence query builder.
getDocumentData ( ) : array Build the document data with the appropriate method.
getDocumentIndex ( ) : mixed Get the model elastic index if available.
getDocumentType ( ) : string Get the model elastic type.
shouldSyncDocument ( ) : boolean; Checks if the model content should be auto synced with elastic.

Protected Methods

Method Description
buildDocumentFromArray ( array $searchable ) : array Build the document from a searchable array.

Method Details

__call() public method

Handle dynamic method calls into the model.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
return mixed

bootSearchable() public static method

Searchable boot model.
public static bootSearchable ( )

buildDocumentFromArray() protected method

Build the document from a searchable array.
protected buildDocumentFromArray ( array $searchable ) : array
$searchable array
return array

document() public method

Start an elastic persistence query builder.
public document ( ) : EloquentPersistence
return Sleimanx2\Plastic\Persistence\EloquentPersistence

getDocumentData() public method

Build the document data with the appropriate method.
public getDocumentData ( ) : array
return array

getDocumentIndex() public method

Get the model elastic index if available.
public getDocumentIndex ( ) : mixed
return mixed

getDocumentType() public method

Get the model elastic type.
public getDocumentType ( ) : string
return string

shouldSyncDocument() public method

Checks if the model content should be auto synced with elastic.
public shouldSyncDocument ( ) : boolean;
return boolean;

Property Details

$documentScore public property

Hit score after querying Elasticsearch.
public null|int $documentScore
return null | integer

$documentVersion public property

Elasticsearch document version.
public null|int $documentVersion
return null | integer

$isDocument public property

Is indexed in elastic search.
public bool $isDocument
return boolean