public function initIndex($indexName)
{
if (empty($indexName)) {
throw new AlgoliaException('Invalid index name: empty string');
}
return new Index($this->context, $this, $indexName);
}
/** * AlgoliaSearchEngine constructor. * @param \AlgoliaSearch\Client $client * @param $index */ public function __construct(\AlgoliaSearch\Client $client, $index, $clearOnSync) { $this->client = $client; $this->index = $client->initIndex($index); $this->clearOnSync = $clearOnSync; $this->index->setSettings(array("attributesToIndex" => array("content", "title", "categories", "tags"), "attributesForFaceting" => array("categories", "tags"))); }