code: @Override
      public void doRun() {
          if (!cluster.isConnected()) {
              LOG.info("Cluster not connected yet, delaying index field type initialization until it is reachable.");
              while (true) {
                  try {
                      cluster.waitForConnectedAndDeflectorHealthy();
                      break;
                  } catch (InterruptedException | TimeoutException e) {
                      LOG.warn("Interrupted or timed out waiting for Elasticsearch cluster, checking again.");
                  }
              }
          }
  
          // We are NOT using IndexSetRegistry#getAll() here because of this: https://github.com/Graylog2/graylog2-server/issues/4625
          indexSetService.findAll().forEach(indexSetConfig -> {
              final String indexSetId = indexSetConfig.id();
              final String indexSetTitle = indexSetConfig.title();
              final Set<IndexFieldTypesDTO> existingIndexTypes = ImmutableSet.copyOf(dbService.findForIndexSet(indexSetId));
  
              final IndexSet indexSet = mongoIndexSetFactory.create(indexSetConfig);
  
              // On startup we check that we have the field types for all existing indices
              LOG.debug("Updating index field types for index set <{}/{}>", indexSetTitle, indexSetId);
              poller.poll(indexSet, existingIndexTypes).forEach(dbService::upsert);
  
              // Make sure we have a polling job for the index set
              if (!futures.containsKey(indexSetId)) {
                  schedule(indexSet);
              }
  
              // Cleanup orphaned field type entries that haven't been removed by the event handler
              dbService.findForIndexSet(indexSetId).stream()
                      .filter(types -> !indices.exists(types.indexName()))
                      .forEach(types -> dbService.delete(types.id()));
          });
      }
docs: This creates index field type information for each index in each index set and schedules polling jobs to
  keep the data for active write indices up to date. It also removes index field type data for indices that
  don't exist anymore.
  <p>
  Since we create polling jobs for the active write indices, this periodical doesn't need to be run very often.