Skip to content

Commit 63098b0

Browse files
committed
Tune down number of ignove_above and multi-fields
1 parent f4ce957 commit 63098b0

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

test/framework/src/main/java/org/elasticsearch/datageneration/datasource/DefaultMappingParametersHandler.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ private Supplier<Map<String, Object>> keywordMapping(boolean hasParent, DataSour
9898
}
9999
}
100100

101-
if (ESTestCase.randomDouble() <= 0.5) {
102-
mapping.put("ignore_above", ESTestCase.randomIntBetween(1, 30));
101+
if (ESTestCase.randomDouble() <= 0.2) {
102+
mapping.put("ignore_above", ESTestCase.randomIntBetween(1, 50));
103103
}
104104
if (ESTestCase.randomDouble() <= 0.2) {
105105
mapping.put("null_value", ESTestCase.randomAlphaOfLengthBetween(0, 10));
106106
}
107-
if (hasParent == false && ESTestCase.randomDouble() <= 0.5) {
108-
mapping.put("fields", stringSubField(FieldType.KEYWORD, request));
107+
if (hasParent == false && ESTestCase.randomDouble() <= 0.3) {
108+
mapping.put("fields", stringSubField(request));
109109
}
110110

111111
return mapping;
@@ -208,8 +208,8 @@ private Supplier<Map<String, Object>> textMapping(boolean hasParent, DataSourceR
208208
mapping.put("store", ESTestCase.randomBoolean());
209209
mapping.put("index", ESTestCase.randomBoolean());
210210

211-
if (hasParent == false && ESTestCase.randomDouble() <= 0.5) {
212-
mapping.put("fields", stringSubField(FieldType.TEXT, request));
211+
if (hasParent == false && ESTestCase.randomDouble() <= 0.3) {
212+
mapping.put("fields", stringSubField(request));
213213
}
214214

215215
return mapping;
@@ -248,14 +248,14 @@ private Supplier<Map<String, Object>> wildcardMapping(boolean hasParent, DataSou
248248
return () -> {
249249
var mapping = new HashMap<String, Object>();
250250

251-
if (ESTestCase.randomDouble() <= 0.3) {
252-
mapping.put("ignore_above", ESTestCase.randomIntBetween(1, 100));
251+
if (ESTestCase.randomDouble() <= 0.2) {
252+
mapping.put("ignore_above", ESTestCase.randomIntBetween(1, 50));
253253
}
254254
if (ESTestCase.randomDouble() <= 0.2) {
255255
mapping.put("null_value", ESTestCase.randomAlphaOfLengthBetween(0, 10));
256256
}
257-
if (hasParent == false && ESTestCase.randomDouble() <= 0.5) {
258-
mapping.put("fields", stringSubField(FieldType.WILDCARD, request));
257+
if (hasParent == false && ESTestCase.randomDouble() <= 0.3) {
258+
mapping.put("fields", stringSubField(request));
259259
}
260260

261261
return mapping;
@@ -268,15 +268,15 @@ private Supplier<Map<String, Object>> matchOnlyTextMapping(
268268
) {
269269
return () -> {
270270
var mapping = new HashMap<String, Object>();
271-
if (hasParent == false && ESTestCase.randomDouble() <= 0.5) {
272-
mapping.put("fields", stringSubField(FieldType.MATCH_ONLY_TEXT, request));
271+
if (hasParent == false && ESTestCase.randomDouble() <= 0.3) {
272+
mapping.put("fields", stringSubField(request));
273273
}
274274
return mapping;
275275
};
276276
}
277277

278-
private Map<String, Object> stringSubField(FieldType parent, DataSourceRequest.LeafMappingParametersGenerator request) {
279-
278+
private Map<String, Object> stringSubField(DataSourceRequest.LeafMappingParametersGenerator request) {
279+
FieldType parent = FieldType.tryParse(request.fieldType());
280280
List<FieldType> stringTypes = List.of(FieldType.TEXT, FieldType.MATCH_ONLY_TEXT, FieldType.KEYWORD, FieldType.WILDCARD);
281281
var childType = ESTestCase.randomValueOtherThan(parent, () -> ESTestCase.randomFrom(stringTypes));
282282
var child = switch (childType) {

test/framework/src/main/java/org/elasticsearch/datageneration/queries/QueryGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public List<QueryBuilder> generateQueries(String type, String path, Object value
4141
return leafQueries.stream().map(q -> wrapInNestedQuery(path, q)).toList();
4242
}
4343

44-
public QueryBuilder wrapInNestedQuery(String path, QueryBuilder leafQuery) {
44+
private QueryBuilder wrapInNestedQuery(String path, QueryBuilder leafQuery) {
4545
String[] parts = path.split("\\.");
4646
List<String> nestedPaths = mappingContextHelper.getNestedPathPrefixes(parts);
4747
QueryBuilder query = leafQuery;

x-pack/plugin/logsdb/src/javaRestTest/java/org/elasticsearch/xpack/logsdb/qa/StandardVersusLogsIndexModeChallengeRestIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ protected StandardVersusLogsIndexModeChallengeRestIT(DataGenerationHelper dataGe
7171
@Override
7272
public void baselineMappings(XContentBuilder builder) throws IOException {
7373
dataGenerationHelper.writeStandardMapping(builder);
74-
int x = 5;
7574
}
7675

7776
@Override

0 commit comments

Comments
 (0)