Skip to content

Commit 9858ef5

Browse files
committed
Improve lookup indices list
1 parent 03a02fb commit 9858ef5

File tree

1 file changed

+7
-14
lines changed
  • x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq

1 file changed

+7
-14
lines changed

x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq/MultiClusterSpecIT.java

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.elasticsearch.test.rest.TestFeatureService;
2525
import org.elasticsearch.xpack.esql.CsvSpecReader;
2626
import org.elasticsearch.xpack.esql.CsvSpecReader.CsvTestCase;
27+
import org.elasticsearch.xpack.esql.CsvTestsDataLoader;
2728
import org.elasticsearch.xpack.esql.SpecReader;
2829
import org.elasticsearch.xpack.esql.qa.rest.EsqlSpecTestCase;
2930
import org.junit.AfterClass;
@@ -45,6 +46,7 @@
4546

4647
import static org.elasticsearch.xpack.esql.CsvSpecReader.specParser;
4748
import static org.elasticsearch.xpack.esql.CsvTestUtils.isEnabled;
49+
import static org.elasticsearch.xpack.esql.CsvTestsDataLoader.CSV_DATASET_MAP;
4850
import static org.elasticsearch.xpack.esql.CsvTestsDataLoader.ENRICH_SOURCE_INDICES;
4951
import static org.elasticsearch.xpack.esql.EsqlTestUtils.classpathResources;
5052
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.FORK_V9;
@@ -210,20 +212,11 @@ protected RestClient buildClient(Settings settings, HttpHost[] localHosts) throw
210212
public static final List<String> METADATA_INDICES = List.of("employees", "apps", "ul_logs");
211213

212214
// These are lookup indices, we want them on both remotes and locals
213-
// TODO: can we somehow find it from the data loader?
214-
public static final Set<String> LOOKUP_INDICES = Set.of(
215-
"languages_nested_fields",
216-
"languages_lookup",
217-
"clientips_lookup",
218-
"languages_mixed_numerics",
219-
"threat_list",
220-
"message_types_lookup",
221-
"host_inventory",
222-
"ownerships",
223-
"languages_lookup_non_unique_key",
224-
"lookup_sample_data_ts_nanos",
225-
"service_owners"
226-
);
215+
public static final Set<String> LOOKUP_INDICES = CSV_DATASET_MAP.values()
216+
.stream()
217+
.filter(td -> td.settingFileName().equals("lookup-settings.json"))
218+
.map(CsvTestsDataLoader.TestDataset::indexName)
219+
.collect(Collectors.toSet());
227220

228221
public static final Set<String> LOOKUP_ENDPOINTS = LOOKUP_INDICES.stream().map(i -> "/" + i + "/_bulk").collect(Collectors.toSet());
229222

0 commit comments

Comments
 (0)