@@ -51,7 +51,6 @@ public DataSourceResponse.LeafMappingParametersGenerator handle(DataSourceReques
5151 case CONSTANT_KEYWORD -> constantKeywordMapping ();
5252 case WILDCARD -> wildcardMapping (false , request );
5353 case MATCH_ONLY_TEXT -> matchOnlyTextMapping (false , request );
54- case PATTERNED_TEXT -> patternedTextMapping (false , request );
5554 });
5655 }
5756
@@ -257,13 +256,13 @@ private Supplier<Map<String, Object>> wildcardMapping(boolean hasParent, DataSou
257256 mapping .put ("null_value" , ESTestCase .randomAlphaOfLengthBetween (0 , 10 ));
258257 }
259258 if (hasParent == false && ESTestCase .randomDouble () <= 0.2 ) {
260- mapping .put ("fields" , stringSubField (FieldType .PATTERNED_TEXT , request ));
259+ mapping .put ("fields" , stringSubField (FieldType .WILDCARD , request ));
261260 }
262261 return mapping ;
263262 };
264263 }
265264
266- private Supplier < Map <String , Object > > stringSubField (FieldType parent , DataSourceRequest .LeafMappingParametersGenerator request ) {
265+ private Map <String , Object > stringSubField (FieldType parent , DataSourceRequest .LeafMappingParametersGenerator request ) {
267266 /**
268267 * text -> keyword, wildcard
269268 * match_only_text -> keyword, wildcard
@@ -272,25 +271,22 @@ private Supplier<Map<String, Object>> stringSubField(FieldType parent, DataSourc
272271 * wildcard -> keyword, text, match_only_text, patterned_text
273272 *
274273 */
275- return () -> {
276- var subFields = new HashMap <FieldType , Supplier <Map <String , Object >>>();
277- subFields .put (FieldType .KEYWORD , () -> {
278- var mapping = keywordMapping (true , request ).get ();
279- mapping .remove ("copy_to" );
280- return mapping ;
281- });
282- subFields .put (FieldType .TEXT , () -> wildcardMapping (true , request ).get ());
283- subFields .put (FieldType .MATCH_ONLY_TEXT , () -> matchOnlyTextMapping (true , request ).get ());
284- subFields .put (FieldType .WILDCARD , () -> wildcardMapping (true , request ).get ());
285- subFields .put (FieldType .PATTERNED_TEXT , () -> matchOnlyTextMapping (true , request ).get ());
286-
287- var options = subFields .entrySet ().stream ().filter (e -> e .getKey ().equals (parent ) == false ).toList ();
288- var child = ESTestCase .randomFrom (options );
289- FieldType childType = child .getKey ();
290- var childValue = child .getValue ().get ();
291- childValue .put ("type" , childType .toString ());
292- return Map .of ("subfield_" + childType , childValue );
293- };
274+ var subFields = new HashMap <FieldType , Supplier <Map <String , Object >>>();
275+ subFields .put (FieldType .KEYWORD , () -> {
276+ var mapping = keywordMapping (true , request ).get ();
277+ mapping .remove ("copy_to" );
278+ return mapping ;
279+ });
280+ subFields .put (FieldType .TEXT , () -> textMapping (true , request ).get ());
281+ subFields .put (FieldType .MATCH_ONLY_TEXT , () -> matchOnlyTextMapping (true , request ).get ());
282+ subFields .put (FieldType .WILDCARD , () -> wildcardMapping (true , request ).get ());
283+
284+ var options = subFields .entrySet ().stream ().filter (e -> e .getKey ().equals (parent ) == false ).toList ();
285+ var child = ESTestCase .randomFrom (options );
286+ FieldType childType = child .getKey ();
287+ var childValue = child .getValue ().get ();
288+ childValue .put ("type" , childType .toString ());
289+ return Map .of ("subfield_" + childType , childValue );
294290 }
295291
296292 private Supplier <Map <String , Object >> matchOnlyTextMapping (boolean hasParent , DataSourceRequest .LeafMappingParametersGenerator request ) {
@@ -303,16 +299,6 @@ private Supplier<Map<String, Object>> matchOnlyTextMapping(boolean hasParent, Da
303299 };
304300 }
305301
306- private Supplier <Map <String , Object >> patternedTextMapping (boolean hasParent , DataSourceRequest .LeafMappingParametersGenerator request ) {
307- return () -> {
308- var mapping = new HashMap <String , Object >();
309- if (hasParent == false && ESTestCase .randomDouble () <= 0.2 ) {
310- mapping .put ("fields" , stringSubField (FieldType .PATTERNED_TEXT , request ));
311- }
312- return mapping ;
313- };
314- }
315-
316302 public static HashMap <String , Object > commonMappingParameters () {
317303 var map = new HashMap <String , Object >();
318304 map .put ("store" , ESTestCase .randomBoolean ());
0 commit comments