/** * Create a new indexer service. * * @param AlgoliaManager $client * @param CustomParser $markdown * @param Filesystem $files * @return void */ public function __construct(AlgoliaManager $client, CustomParser $markdown, Filesystem $files) { $this->files = $files; $this->client = $client; $this->markdown = $markdown; $this->index = $client->initIndex(static::$index_name . '_tmp'); }
/** * Index Exists. * * Does this index exist? * * @return bool */ public function indexExists() { foreach (Arr::get($this->client->listIndexes(), 'items', []) as $index) { if ($index['name'] == $this->getConfigurator()->index()) { return true; } } return false; }