@@ -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 ) {
0 commit comments