diff --git a/src/Form/IndexClearConfirmForm.php b/src/Form/IndexClearConfirmForm.php index fbacefb..9b6fc59 100644 --- a/src/Form/IndexClearConfirmForm.php +++ b/src/Form/IndexClearConfirmForm.php @@ -38,11 +38,16 @@ class IndexClearConfirmForm extends EntityConfirmFormBase { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { + // Put following line in your settings php to override the server. + // $config['search_api.index.{index_machine_name}']['server'] = 'another'; + + drupal_set_message('stored config: ' . $this->entity->getServerId()); /** @var \Drupal\search_api\IndexInterface $index */ - $index = $this->getEntity(); + $index = $this->entity->load($this->entity->id()); + drupal_set_message('loaded config: ' . $index->getServerId()); try { - $index->clear(); + //$index->clear(); } catch (SearchApiException $e) { drupal_set_message($this->t('Failed to clear the search index %name.', array('%name' => $index->label())), 'error');