Skip to content

Elasticsearch index_exists? check should only happen when changing Advanced Search settings

Problem

As pointed out by @terrichu in !54180 (comment 510352625) we've observed that we seem to be calling index_exists? when changing any admin settings. This is wasteful and probably also leads to needless risk of 5XX responses for pages that have nothing to do with Elasticsearch

Solution

We should only check this when changing some settings related to Advanced Search. Luckily we recently moved advanced search settings to a dedicated admin page so this should be easier to accomplish now as we can make it so that we only do it when saving that form.