Skip to content

Commit

Permalink
Clean up search fix
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative committed Nov 28, 2023
1 parent 2e85537 commit 6bc8dcc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions site/plugins/search/src/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ class Search
public function __construct()
{
$this->options = App::instance()->option('search.algolia', []);
$this->options['key'] = App::instance()->option('keys.algolia');

if (isset($this->options['app']) === false) {
throw new Exception('Please set your Algolia API credentials in the Kirby configuration.');
}

// use the search-only API key as fallback
$this->options['key'] = App::instance()->option('keys.algolia', 'd161a2f4cd2d69247c529a3371ad3050');

$this->algolia = Algolia::create(
$this->options['app'],
// use the search-only API key as fallback
option('keys.algolia', 'd161a2f4cd2d69247c529a3371ad3050')
$this->options['key']
);
}

Expand Down

0 comments on commit 6bc8dcc

Please sign in to comment.