diff --git a/INSTALL.txt b/INSTALL.txt
deleted file mode 100644
index d623f46..0000000
--- a/INSTALL.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-INSTALLING MODULES AND LIBRARIES
---------------------------------
- * Download the module and all of its dependencies. Move them to the contributed
-   modules location in your tree (e.g. sites/all/modules).
- 
- * Downlaod Algolia search client PHP library from https://github.com/algolia
-   /algoliasearch-client-php and move it into the external libraries location in
-   your tree (e.g /sites/all/libraries). From that location, the 
-   algoliasearch.php file should be accessible from algolia/algoliasearch.php  
-   (e.g. /sites/all/libraries/algolia/algoliasearch.php).
- 
- * Enable the module's dependencies on the modules admin page (/admin/modules).
-
-
-CONFIGURING SEARCH API SERVER AND INDEX
----------------------------------------
- * On the Search API administration page (/admin/config/search/search_api), add
-   a new server and check the "Enabled" checkbox. In the "ALGOLIA" section, fill
-   in your Application ID and API key found in your Algolia dashboard on 
-   https://www.algolia.com.
- 
- * On the Search API administration page (/admin/config/search/search_api), add
-   a new index, enable it and select the server you just created in the previous
-   section. The index name provided will be used to create a new index on the
-   Algolia platform. Please read the "Known problems" section of the README.txt
-   file for the latest updates about the type of entity supported.
- 
- * On the "Fields" tab of your index
-   (/admin/config/search/search_api/index/[YOUR INDEX NAME]/fields), check all
-   the fields you want to have indexed in the Algolia index. At the very least,
-   the entity ID field for the indexed entity type needs to be checked off (nid
-   for nodes, uid for users, etc.). Please read the "Known problems" section of
-   the README.txt file for the latest updates about the type of fields 
-   supported.
- 
- * On the "Filters" of your index (/admin/config/search/search_api/index/[YOUR
-   INDEX NAME]/workflow), select the filters you want to apply before the data 
-   is being sent to Algolia's servers. A good starting combination could be 
-   "Bundle filter" (allowing you to index entities of certain bundles only (or 
-   content types in the node realm)), "Node access" and "Exclude unpublished 
-   nodes". Please read the "Known problems" section of the README.txt file for 
-   the latest updates about the type of filters supported.
-
-
-INDEXING CONTENT
-----------------
-* On your newly created index page, (/admin/config/search/search_api/index/[YOUR
-  INDEX NAME]), click the "Index now" button. You should start seeing content
-  populating the index in the Algolia dashboard on https://www.algolia.com.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..7513c1f
--- /dev/null
+++ b/README.md
@@ -0,0 +1,2 @@
+# search_api_algolia
+Drupal 8 version Search API implementation to Algolia
diff --git a/README.txt b/README.txt
deleted file mode 100644
index e6cde9a..0000000
--- a/README.txt
+++ /dev/null
@@ -1,76 +0,0 @@
-CONTENTS OF THIS FILE
----------------------
- * Introduction
- * Requirements
- * Installation
- * Known problems
- * Maintainers
- * Dependencies
-
-
-INTRODUCTION
-------------
-This module provides integration with the Algolia service
-(https://www.algolia.com), through Drupal's Search API. This module is intended
-to be used by developers, as it does not currently provide any implementation of
-an actual search interface. Only indexing is currently supported. As a result,
-enabling that module will not have any visible effect on your application.
-Search functionality may be implemented using the Algolia Javascript API.
-
-Currently supported:
- * initial indexing of node entities (see "Know problems")
- * re-indexing on node updates or through forced re-index action
-
-Type of fields which have been successfully tested:
- * entity reference fields (either single or multivalued)
- * standard text fields containing either strings or integers (integer support 
-   is important for comparison functions in the search query)
-
-
-REQUIREMENTS
-------------
-This module requires the following modules:
- * Libraries API (https://www.drupal.org/project/libraries)
- * Search API (https://www.drupal.org/project/search_api)
- * Entity API (https://www.drupal.org/project/entity)
-
-This module also uses the following library:
- * Algolia search client PHP library 
-   https://github.com/algolia/algoliasearch-client-php
-
-
-INSTALLATION
-------------
-Please refer to the INSTALL.txt file.
-
-
-KNOWN PROBLEMS
---------------
- * At the moment, the HTML filter (Index > Filters > Processors) with Tag boosts
-   is not supported as it creates separate entries in the items tree. Please 
-   make sure that the "Tag boosts" text area is empty.
- * Only node entities are supported for now. User entities have been 
-   successfully implemented but more tests need to be completed.
- * Standard multi-valued select fields are not indexed properly as both key and
-   value are shown in the resulting indexed data.
- * "Clear all indexed data" button on the index page is not implemented yet, as 
-   it collided with normal indexing operations. To clear the index, please 
-   proceed from the Algolia dashboard.
-
-
-MAINTAINERS
------------
-Current maintainer: Matthieu Bergel (mbrgl) - https://www.drupal.org/user/489214
-
-The initial development of this module has been sponsored by TroisCube 
-(http://www.troiscube.com).
-
-
-DEPENDENCIES
-------------
-This module requires an account on https://www.algolia.com, where you will be
-able to generate the required Application ID and API key. A 14-day free trial
-period is granted with every new account.
-
-Pricing options can be found on the Algolia website: 
-https://www.algolia.com/pricing
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..b607115
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,24 @@
+{
+  "name": "drupal/search_api_algolia",
+  "description": "Provides integration with the Algolia search engine.",
+  "type": "drupal-module",
+  "homepage": "https://www.drupal.org/project/search_api_algolia",
+  "authors": [
+    {
+      "name": "Jens Beltofte",
+      "homepage": "https://www.drupal.org/u/beltofte"
+    },
+    {
+      "name": "Jonas Krat",
+      "homepage": "https://www.drupal.org/u/jonasdk"
+    }
+  ],
+  "support": {
+    "issues": "https://www.drupal.org/project/issues/search_api_algolia",
+    "source": "http://git.drupal.org/project/search_api_algolia.git"
+  },
+  "license": "GPL-2.0+",
+  "require": {
+    "algolia/algoliasearch-client-php": ">=1.6.3"
+  }
+}
diff --git a/includes/service.inc b/includes/service.inc
deleted file mode 100644
index 97bd548..0000000
--- a/includes/service.inc
+++ /dev/null
@@ -1,234 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains SearchApiAlgoliaService.
- */
-
-/**
- * SearchApiAlgoliaService class.
- */
-class SearchApiAlgoliaService extends SearchApiAbstractService {
-
-  protected $algoliaIndex = NULL;
-
-
-  /**
-   * Get the Algolia index.
-   */
-  protected function getAlgoliaIndex() {
-    return $this->algoliaIndex;
-  }
-
-
-  /**
-   * Set the Algolia index.
-   */
-  protected function setAlgoliaIndex($index) {
-    $this->algoliaIndex = $index;
-  }
-
-
-  /**
-   * Connect to the Algolia service.
-   *
-   * Uses the application ID et API key provided in the UI.
-   */
-  protected function connect($index) {
-    // @todo Make the absence of lib more visible (error message on the status
-    // report page for instance, and during the install process).
-    if (($library = libraries_load('algolia')) && !empty($library['loaded'])) {
-      $algolia_client = new \AlgoliaSearch\Client($this->getApplicationID(), $this->getApiKey());
-      $this->setAlgoliaIndex($algolia_client->initIndex($index->name));
-    }
-    else {
-      throw new SearchApiException(t('Algolia library could not be found or did not load properly.'));
-    }
-  }
-
-
-  /**
-   * Get the ApplicationID (provided by Algolia).
-   */
-  protected function getApplicationId() {
-    return $this->options['application_id'];
-  }
-
-
-  /**
-   * Get the API key (provided by Algolia).
-   */
-  protected function getApiKey() {
-    return $this->options['api_key'];
-  }
-
-
-  /**
-   * Defines the configuration form displayed when creating a new server.
-   */
-  public function configurationForm(array $form, array &$form_state) {
-
-    $form['application_id'] = array(
-      '#type' => 'textfield',
-      '#title' => t('Application ID'),
-      '#size' => 60,
-      '#maxlength' => 128,
-      '#required' => TRUE,
-      '#default_value' => $this->getApplicationId(),
-    );
-
-    $form['api_key'] = array(
-      '#type' => 'textfield',
-      '#title' => t('API key'),
-      '#size' => 60,
-      '#maxlength' => 128,
-      '#required' => TRUE,
-      '#default_value' => $this->getAPIKey(),
-    );
-
-    return $form;
-  }
-
-
-  /**
-   * Implements viewSettings.
-   */
-  public function viewSettings() {
-    // @todo Write service options (SearchApiAlgoliaService class).
-    $output = '';
-
-    return $output;
-  }
-
-
-  /**
-   * Implements indexItems.
-   *
-   * Naming convention:
-   * - items
-   *   - item
-   *     - property
-   *       - type
-   *       - entity_type
-   *       - value : single value or array.
-   */
-  public function indexItems(SearchApiIndex $index, array $items) {
-    $items_to_index = array();
-    $items_indexed = array();
-
-    // Retrieving the entity key ('nid' for nodes, 'uid' for users, etc...).
-    $entity_key = entity_get_info($index->item_type)['entity keys']['id'];
-
-    // Connect to the Algolia service.
-    $this->connect($index);
-
-    // Iterate over all the items ready for indexing.
-    foreach ($items as $item) {
-      $item_to_index = array();
-      // And then iterate over all the properties of these items.
-      foreach ($item as $key => $property) {
-        // Do not index the property if its value is not set.
-        if (isset($property['value'])) {
-          // Do not process the entity id at that stage. Its value is indexed
-          // separately as it requires a special property name (ObjectID) in
-          // order to be indexed by Algolia.
-          if ($key != $entity_key) {
-            // If the property type is defined as a list and entity_type is set,
-            // we are facing a multivalued entity (checking list<integeger> is
-            // not enough as this could be used by a standard select, with no
-            // reference).
-            // @todo Handle multivalued fields which are not entity reference.
-            if (preg_match('/^list<[^>]+>/', $property['type']) && isset($property['entity_type'])) {
-              $entity_type = $property['entity_type'];
-              foreach ($property['value'] as $property_list_value) {
-                $wrapper = entity_metadata_wrapper($entity_type, entity_load_single($entity_type, $property_list_value));
-                $item_to_index[$key][] = $wrapper->label();
-              }
-            }
-            // The property only bears a single value.
-            else {
-              // If entity_type is defined, it means we are facing an entity
-              // reference. We then use an entity wrapper to output it.
-              if (isset($property['entity_type'])) {
-                $entity_type = $property['entity_type'];
-                $wrapper = entity_metadata_wrapper($entity_type, entity_load_single($entity_type, $property['value']));
-                $property_value = $wrapper->label();
-              }
-              // Simple property value (no entity to dereference).
-              else {
-                if ($property['type'] == 'integer') {
-                  // We need to transtype the content of integer fields (as they
-                  // are stored as string) so that Algolia sees them as
-                  // integers.
-                  // @todo MAYBE: if more types need to be recognized, make
-                  // something more scalable here.
-                  $property_value = (int) $property['value'];
-                }
-                else {
-                  $property_value = $property['value'];
-                }
-              }
-              $item_to_index[$key] = $property_value;
-            }
-          }
-          else {
-            // Match the entity key to the objectID primary key required by
-            // Algolia.
-            $item_to_index['objectID'] = $item[$entity_key]['value'];
-          }
-        }
-      }
-      // Add the properly formatted items to the batch.
-      $items_to_index[] = $item_to_index;
-    }
-
-    try {
-      // Once a batch is ready, send them over to Algolia.
-      $items_indexed = $this->getAlgoliaIndex()->saveObjects($items_to_index);
-    }
-    catch (Exception $e) {
-      throw new SearchApiException($e->getMessage());
-    }
-
-    // Returns an array of properly indexed objectIDs for Search API's
-    // statistics. Depending on the type of entity being indexed, this can be
-    // an array of 'nids', 'uids', 'tids', etc...
-    return $items_indexed['objectIDs'];
-  }
-
-
-  /**
-   * Implements deleteItems.
-   */
-  public function deleteItems($ids = 'all', SearchApiIndex $index = NULL) {
-    // Connect to the Algolia service.
-    $this->connect($index);
-
-    if ($ids == 'all') {
-      // Action triggered from the index admin page, when "Clear all indexed
-      // data" button is clicked.
-      $this->getAlgoliaIndex()->clearIndex();
-    }
-    else {
-      // Action triggered when individual nodes are deleted. When deleting
-      // multiple nodes from the admin content page, DeleteItems is being called
-      // as many times as the number of nodes being deleted, making the foreach
-      // irrelevant. There might be other contexts in which calls to deleteItems
-      // are bundled though.
-      foreach ($ids as $id) {
-        $this->getAlgoliaIndex()->deleteObject($id);
-      }
-    }
-  }
-
-
-  /**
-   * Implements search.
-   */
-  public function search(SearchApiQueryInterface $query) {
-    // Set 'result count' at 0 by default.
-    $result = array('result count' => 0);
-    return $result;
-  }
-
-}
diff --git a/search_api_algolia.api.php b/search_api_algolia.api.php
new file mode 100644
index 0000000..27aea48
--- /dev/null
+++ b/search_api_algolia.api.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ * @file
+ * Hooks provided by the Search API Algolia search module.
+ */
+
+/**
+ * @addtogroup hooks
+ * @{
+ */
+
+/**
+ * Alter Algolia objects before they are sent to Algolia for indexing.
+ *
+ * @param $objects
+ *   An array of objects ready to be indexed, generated from $items array.
+ * @param \Drupal\search_api\IndexInterface $index
+ *   The search index for which items are being indexed.
+ * @param \Drupal\search_api\Item\ItemInterface[] $items
+ *   An array of items to be indexed, keyed by their item IDs.
+ */
+function hook_search_api_algolia_objects_alter(array &$objects, \Drupal\search_api\IndexInterface $index, array $items) {
+  // Adds a "foo" field with value "bar" to all documents.
+  foreach ($objects as $key => $object) {
+    $objects[$key]['foo'] = 'bar';
+  }
+}
+
+/**
+ * @} End of "addtogroup hooks".
+ */
\ No newline at end of file
diff --git a/search_api_algolia.info b/search_api_algolia.info
deleted file mode 100644
index 0698b66..0000000
--- a/search_api_algolia.info
+++ /dev/null
@@ -1,12 +0,0 @@
-name = Algolia search
-description = Provides integration with the Algolia search engine
-package = Search
-core = 7.x
-
-files[] = includes/service.inc
-
-dependencies[] = search_api
-dependencies[] = libraries
-dependencies[] = entity 
-
-#configure = admin/config/content/example
diff --git a/search_api_algolia.info.yml b/search_api_algolia.info.yml
new file mode 100644
index 0000000..a374c38
--- /dev/null
+++ b/search_api_algolia.info.yml
@@ -0,0 +1,7 @@
+type: module
+name: 'Algolia Search'
+description: 'Provides integration with the Algolia search engine'
+core: 8.x
+package: Search
+dependencies:
+ - search_api
\ No newline at end of file
diff --git a/search_api_algolia.install b/search_api_algolia.install
new file mode 100644
index 0000000..e2ee22e
--- /dev/null
+++ b/search_api_algolia.install
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * Implements hook_requirements().
+ */
+function search_api_algolia_requirements($phase) {
+  $requirements = [];
+  if ($phase == 'install') {
+    if (!class_exists('\AlgoliaSearch\Version')) {
+      $requirements['search_api_algolia_library'] = [
+        'description' => t('Algolia Search requires the algolia/algoliasearch-client-php library.'),
+        'severity' => REQUIREMENT_ERROR,
+      ];
+    }
+  }
+
+  return $requirements;
+}
\ No newline at end of file
diff --git a/search_api_algolia.module b/search_api_algolia.module
index 4b8fefa..22db84c 100644
--- a/search_api_algolia.module
+++ b/search_api_algolia.module
@@ -2,50 +2,7 @@
 
 /**
  * @file
- * Main module file for search_api_algolia.
+ * Provides an Algolia Search based service class for the Search API.
  */
 
-/**
- * Implements hook_info().
- */
-function search_api_algolia_search_api_service_info() {
-  $services['algolia'] = array(
-    'name' => t('Algolia'),
-    'description' => t('Provides integration with the Algolia search engine service'),
-    'class' => 'SearchApiAlgoliaService',
-  );
-
-  return $services;
-}
-
-/**
- * Implements hook_libraries_info().
- *
- * For defining external libraries.
- */
-function search_api_algolia_libraries_info() {
-
-  // A very simple library. No changing APIs (hence, no versions), no variants.
-  // Expected to be extracted into 'sites/all/libraries/simple'.
-  $libraries['algolia'] = array(
-    'name' => 'Algolia PHP library',
-    'vendor url' => 'https://www.algolia.com/',
-    'download url' => 'https://github.com/algolia/algoliasearch-client-php',
-    'version callback' => 'search_api_algolia_libraries_version_callback',
-    'files' => array(
-      'php' => array('algoliasearch.php'),
-    ),
-  );
-
-  return $libraries;
-}
-
-/**
- * Defines the version number of the external algolia library.
- *
- * @todo
- */
-function search_api_algolia_libraries_version_callback() {
-  // Use some fancy magic to get the version number... or don't
-  return TRUE;
-}
+use Drupal\search_api_algolia\Plugin\search_api\backend;
\ No newline at end of file
diff --git a/src/Plugin/search_api/backend/SearchApiAlgoliaBackend.php b/src/Plugin/search_api/backend/SearchApiAlgoliaBackend.php
new file mode 100644
index 0000000..804d231
--- /dev/null
+++ b/src/Plugin/search_api/backend/SearchApiAlgoliaBackend.php
@@ -0,0 +1,303 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\search_api_algolia\Plugin\search_api\backend\SearchApiAlgoliaBackend.
+ */
+
+namespace Drupal\search_api_algolia\Plugin\search_api\backend;
+
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Field;
+use Drupal\search_api\Item\ItemInterface;
+use Drupal\search_api\IndexInterface;
+use Drupal\search_api\Query\QueryInterface;
+use Drupal\search_api\Backend\BackendPluginBase;
+use Drupal\search_api\Utility;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+ * @SearchApiBackend(
+ *   id = "search_api_algolia",
+ *   label = @Translation("Algolia"),
+ *   description = @Translation("Index items using a Algolia Search.")
+ * )
+ */
+class SearchApiAlgoliaBackend extends BackendPluginBase {
+
+  protected $algoliaIndex = NULL;
+
+  /**
+   * A connection to the Algolia server.
+   *
+   * @var \AlgoliaSearch\Client
+   */
+  protected $algoliaClient;
+
+  /**
+   * The module handler.
+   *
+   * @var \Drupal\Core\Extension\ModuleHandlerInterface
+   */
+  protected $moduleHandler;
+
+  /**
+   * {@inheritdoc}
+   */
+  public function __construct(array $configuration, $plugin_id, array $plugin_definition, ModuleHandlerInterface $module_handler) {
+    parent::__construct($configuration, $plugin_id, $plugin_definition);
+    $this->moduleHandler = $module_handler;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
+    return new static(
+      $configuration,
+      $plugin_id,
+      $plugin_definition,
+      $container->get('module_handler')
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function defaultConfiguration() {
+    return array(
+      'application_id' => '',
+      'api_key' => '',
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
+    $form['help'] = array(
+      '#markup' => '<p>' . $this->t('The application ID and API key an be found and configured at <a href="@link" target="blank">@link</a>.', array('@link' => 'https://www.algolia.com/licensing')) . '</p>',
+    );
+    $form['application_id'] = array(
+      '#type' => 'textfield',
+      '#title' => $this->t('Application ID'),
+      '#description' => $this->t('The application ID from your Algolia subscription.'),
+      '#default_value' => $this->getApplicationId(),
+      '#required' => TRUE,
+      '#size' => 60,
+      '#maxlength' => 128,
+    );
+    $form['api_key'] = array(
+      '#type' => 'textfield',
+      '#title' => $this->t('API Key'),
+      '#description' => $this->t('The API key from your Algolia subscription.'),
+      '#default_value' => $this->getApiKey(),
+      '#required' => TRUE,
+      '#size' => 60,
+      '#maxlength' => 128,
+    );
+    return $form;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function viewSettings() {
+    $this->connect();
+    $info = array();
+
+    // Application ID
+    $info[] = array(
+      'label' => $this->t('Application ID'),
+      'info' => $this->getApplicationId(),
+    );
+
+    // API Key
+    $info[] = array(
+      'label' => $this->t('API Key'),
+      'info' => $this->getApiKey(),
+    );
+
+    // Available indexes
+    $indexes = $this->getAlgolia()->listIndexes();
+    $indexes_list = array();
+    if (isset($indexes['items'])) {
+      foreach ($indexes['items'] as $index) {
+        $indexes_list[] = $index['name'];
+      }
+    }
+    $info[] = array(
+      'label' => $this->t('Available Algolia indexes'),
+      'info' => implode(', ', $indexes_list),
+    );
+
+    return $info;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function removeIndex($index) {
+    // Only delete the index's data if the index isn't read-only.
+    if (!is_object($index) || empty($index->get('read_only'))) {
+      $this->deleteAllIndexItems($index);
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function indexItems(IndexInterface $index, array $items) {
+    $this->connect($index);
+
+    $objects = array();
+    /** @var \Drupal\search_api\Item\ItemInterface[] $items */
+    foreach ($items as $id => $item) {
+      $objects[$id] = $this->indexItem($index, $item);
+    }
+
+    // Let other modules alter objects before sending them to Algolia.
+    \Drupal::moduleHandler()->alter('search_api_algolia_objects', $objects, $index, $items);
+    $this->alterAlgoliaObjects($objects, $index, $items);
+
+    if (count($objects) > 0) {
+      try {
+        $this->getAlgoliaIndex()->addObjects($objects);
+      }
+      catch (AlgoliaException $e) {
+        $this->getLogger()->warning(Html::escape($e->getMessage()));
+      }
+    }
+
+    return array_keys($objects);
+  }
+
+  /**
+   * Indexes a single item on the specified index.
+   *
+   * Used as a helper method in indexItems().
+   *
+   * @param \Drupal\search_api\IndexInterface $index
+   *   The index for which the item is being indexed.
+   * @param \Drupal\search_api\Item\ItemInterface $item
+   *   The item to index.
+   */
+  protected function indexItem(IndexInterface $index, ItemInterface $item) {
+    $item_id = $item->getId();
+    $item_to_index = array('objectID' => $item_id);
+
+    /** @var \Drupal\search_api\Item\FieldInterface $field */
+    foreach ($item as $key => $field) {
+      $item_to_index[$field->getFieldIdentifier()] = $field->getValues();
+    }
+
+    return $item_to_index;
+  }
+
+  /**
+   * Applies custom modifications to indexed Algolia objects.
+   *
+   * This method allows subclasses to easily apply custom changes before the
+   * objects are sent to Algolia. The method is empty by default.
+   *
+   * @param $objects
+   *   An array of objects ready to be indexed, generated from $items array.
+   * @param \Drupal\search_api\IndexInterface $index
+   *   The search index for which items are being indexed.
+   * @param array $items
+   *   An array of items being indexed.
+   *
+   * @see hook_search_api_algolia_objects_alter()
+   */
+  protected function alterAlgoliaObjects(array &$objects, IndexInterface $index, array $items) {
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function deleteItems(IndexInterface $index, array $ids) {
+    // Connect to the Algolia service.
+    $this->connect($index);
+
+    // Deleting all items included in the $ids array.
+    foreach ($ids as $id) {
+      $this->getAlgoliaIndex()->deleteObject($id);
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function deleteAllIndexItems(IndexInterface $index = NULL) {
+    if ($index) {
+      // Connect to the Algolia service.
+      $this->connect($index);
+
+      // Clcearing the full index.
+      $this->getAlgoliaIndex()->clearIndex();
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function search(QueryInterface $query) {
+    // This plugin does not support searching and we therefore just return an empty search result.
+    $results = Utility::createSearchResultSet($query);
+    $results->setResultItems(array());
+    $results->setResultCount(0);
+    return $results;
+  }
+
+  /**
+   * Creates a connection to the Algolia Search server as configured in $this->configuration.
+   */
+  protected function connect($index = NULL) {
+    if (!$this->getAlgolia()) {
+      $this->algoliaClient = new \AlgoliaSearch\Client($this->getApplicationId(), $this->getApiKey());
+
+      if ($index && $index instanceof IndexInterface) {
+        $this->setAlgoliaIndex($this->algoliaClient->initIndex($index->get('name')));
+      }
+    }
+  }
+
+  /**
+   * Returns the AlgoliaSearch client.
+   *
+   * @return \AlgoliaSearch\Client
+   *   The algolia instance object.
+   */
+  public function getAlgolia() {
+    return $this->algoliaClient;
+  }
+
+  /**
+   * Get the Algolia index.
+   */
+  protected function getAlgoliaIndex() {
+    return $this->algoliaIndex;
+  }
+
+  /**
+   * Set the Algolia index.
+   */
+  protected function setAlgoliaIndex($index) {
+    $this->algoliaIndex = $index;
+  }
+
+  /**
+   * Get the ApplicationID (provided by Algolia).
+   */
+  protected function getApplicationId() {
+    return $this->configuration['application_id'];
+  }
+
+  /**
+   * Get the API key (provided by Algolia).
+   */
+  protected function getApiKey() {
+    return $this->configuration['api_key'];
+  }
+}
\ No newline at end of file
