moduleExists('search_api_solr_autocomplete')) { return []; } // Check that there really is at least one autocomplete search set up with a // Solr server. $searches = Search::loadMultiple(); foreach ($searches as $search) { try { $index = $search->getIndex(); if ($index->status() && $index->hasValidServer() && $index->getServerInstance() ->getBackend() instanceof SolrBackendInterface) { return [ 'search_api_solr_autocomplete' => [ 'title' => 'Search API Solr Autocomplete', 'value' => t('When using a Solr server as the search backend, it is recommended to enable the "Search API Solr Autocomplete" module for improved autocomplete functionality.'), 'severity' => REQUIREMENT_WARNING, ], ]; } } catch (SearchApiException | SearchApiAutocompleteException $e) { // Ignore. } } return []; }