@Override public List<String> execute() throws Exception { List<String> indexes = new ArrayList<String>(); FixtureConfiguration fixtureConfiguration = cfgProvider.get().getFixtureConfiguration(); Set<String> indexNames = new HashSet<String>(); for (String index : fixtureConfiguration.getIndexNames()) { for (String type : fixtureConfiguration.getIndexConfig(index).getTypeNames()) { final Iterable<TypeConfig> configs = Configurations.configsFor(cfgProvider.get(), index, type); for (TypeConfig typeConfig : configs) { indexNames.add(typeConfig.targetIndex()); } } } for (String indexName : indexNames) { log.debug("Creating index [{}]", indexName); FixtureIndexConfiguration indexConfig = fixtureConfiguration.getIndexConfig(indexName); try { client.admin().indices().create(buildCreateIndexRequest(indexName, indexConfig)).get(); indexes.add(indexName); } catch (Exception e) { throw new Exception("something went wrong creating index [" + indexName + "]", e); } } return indexes; }