Commit 9b8557e8 authored by Adam Bramley's avatar Adam Bramley Committed by Kim Pepper
Browse files

Issue #3272830 by acbramley: Update index throws exception if index doesn't exist

parent 8766765b
Loading
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -257,9 +257,15 @@ class BackendClient implements BackendClientInterface {
   * {@inheritdoc}
   */
  public function updateIndex(IndexInterface $index): void {
    if ($this->indexExists($index)) {
      $index->clear();
      $this->updateSettings($index);
      $this->updateFieldMapping($index);
    }
    else {
      $this->addIndex($index);
    }
  }

  /**
   * Updates the field mappings for an index.