Switch search source when deleting an index in ES administration

Summary

This is a follow-up to !17230 (closed) / !18254 (merged) / !20421 (merged).

Currently a user can't delete an index if it's the active search source, and has to mark another index as active search source first. Also, the last remaining index can't be deleted.

Improvements

In the backend, we need to accept an index ID in the DELETE /elasticsearch_indices/:id endpoint and mark it as the new active search source. If the last remaining index is deleted, ES searching and indexing needs to be disabled.

In the frontend, this should be implemented as in the proposed designs:

State Design
No other index exists image
One other index exists image
More than one other index exists image

Involved components

  • ee/app/assets/javascripts/elasticsearch/
    • The code for this already exists, but is commented out.
  • ee/app/services/elastic/destroy_index_service.rb
  • ee/lib/api/elasticsearch_indices.rb
Edited Dec 04, 2019 by Markus Koller
Assignee Loading
Time tracking Loading