Class SourceTransforms

java.lang.Object
org.elasticsearch.datageneration.matchers.source.SourceTransforms

public class SourceTransforms extends Object
  • Constructor Details

    • SourceTransforms

      public SourceTransforms()
  • Method Details

    • normalize

      public static Map<String,List<Object>> normalize(Map<String,Object> documentMap, Map<String,Map<String,Object>> mappingLookup)
      This preprocessing step makes it easier to match the document using a unified structure. It performs following modifications:
      • Flattens all nested maps into top level map with full field path as key (e.g. "a.b.c.d")
      • Transforms all field values to arrays of length >= 1

      It also makes it possible to work with subobjects: false/auto settings.

      Returns:
      flattened map
    • normalizeValues

      public static <T> List<T> normalizeValues(List<T> values)
    • normalizeValues

      public static <T, U> List<U> normalizeValues(List<T> values, Function<T,U> transform)