commit 9dc8681c5687d067f3b916341e24d26b1c5591a7
Author: fago <nuppla@zites.net>
Date:   Fri Nov 10 23:01:02 2017 +0100

    Update mapping.

diff --git a/src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php b/src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php
index fadf691..4c0e646 100644
--- a/src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php
+++ b/src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php
@@ -367,24 +367,28 @@ class SearchApiElasticsearchBackend extends BackendPluginBase implements PluginF
    * {@inheritdoc}
    */
   public function addIndex(IndexInterface $index) {
-    $index_name = IndexFactory::getIndexName($index);
-    if (!empty($index_name)) {
-      try {
-        if (!$this->client->indices()->exists(IndexFactory::index($index))) {
-          $response = $this->client->indices()->create(
-            IndexFactory::create($index)
-          );
-          if (!$this->client->CheckResponseAck($response)) {
-            drupal_set_message($this->t('The elasticsearch client was not able to create index'), 'error');
-          }
-        }
+    $this->updateIndex($index);
+  }
 
-        // Update mapping.
-        $this->fieldsUpdated($index);
-      }
-      catch (ElasticsearchException $e) {
-        drupal_set_message($e->getMessage(), 'error');
+  /**
+   * {@inheritdoc}
+   */
+  public function updateIndex(IndexInterface $index) {
+    try {
+      if (!$this->client->indices()->exists(IndexFactory::index($index))) {
+        $response = $this->client->indices()->create(
+          IndexFactory::create($index)
+        );
+        if (!$this->client->CheckResponseAck($response)) {
+          drupal_set_message($this->t('The elasticsearch client was not able to create index'), 'error');
+        }
       }
+
+      // Update mapping.
+      $this->fieldsUpdated($index);
+    }
+    catch (ElasticsearchException $e) {
+      drupal_set_message($e->getMessage(), 'error');
     }
   }
 
