Algolia search-as-a-service integration for Craft CMS.
To install Algolia, follow these steps:
- Download & unzip the file and place the
algolia
directory into yourcraft/plugins
directory - Install plugin in the Craft Control Panel under Settings > Plugins
Algolia works on Craft 2.4.x and Craft 2.5.x.
You’ll need to create a algolia.php
configuration file in craft/config
.
Please see sample configuration below.
<?php
namespace Craft;
return [
'applicationId' => 'LDUJXDVEZY',
'adminApiKey' => 'vh9ldujxdvezysilfnurwbniaddfmygb',
'indicies' => [
'newsPosts' => [
'elementType' => 'entry',
'filter' => function(BaseElementModel $element) {
return $element->section->handle == 'news';
},
'transformer' => function(BaseElementModel $element) {
return [
'title' => $element->title,
'body' => (string) $element->body,
];
}
],
],
];