26 lines
500 B
PHP
26 lines
500 B
PHP
<?php
|
|
namespace App\Http\Traits;
|
|
use Elasticquent\ElasticquentTrait;
|
|
|
|
trait ElasticTrait {
|
|
|
|
use ElasticquentTrait;
|
|
|
|
/**
|
|
* Index Exists.
|
|
*
|
|
* Does this index exist?
|
|
*
|
|
* @return bool
|
|
*/
|
|
public static function indexExists()
|
|
{
|
|
$instance = new static;
|
|
$client = $instance->getElasticSearchClient();
|
|
$index = array(
|
|
'index' => $instance->getIndexName(),
|
|
);
|
|
return $client->indices()->exists($index);
|
|
}
|
|
|
|
}
|