code: public List<String> purgeIndexes(final Set<String> prefixes) 
            throws IndexException {
      final Set<IndexInfo> indexes = getIndexInfo();
      final List<String> purged = new ArrayList<>();
  
      if (Util.isEmpty(indexes)) {
        return purged;
      }
  
      purge:
      for (final IndexInfo ii: indexes) {
        final String idx = ii.getIndexName();
  
        if (!hasPrefix(idx, prefixes)) {
          continue purge;
        }
  
        /* Don't delete those pointed to by any aliases */
  
        if (!Util.isEmpty(ii.getAliases())) {
          continue purge;
        }
  
        purged.add(idx);
      }
  
      deleteIndexes(purged);
  
      return purged;
    }
docs: Remove any index that doesn't have an alias and starts with
  the given prefix
  
  @param prefixes Ignore indexes that have names that don't start
  with any of these
  @return list of purged indexes
  @throws IndexException