private static VsmfieldsConfig.Fieldspec.Normalize.Enum toNormalize(Matching matching) {
            // The ordering/priority below is important.
            // exact = > lowercase only
            if (matching.getType() == MatchType.EXACT) return VsmfieldsConfig.Fieldspec.Normalize.Enum.LOWERCASE;
            // cased takes priority
            if (matching.getCase() == Case.CASED) return VsmfieldsConfig.Fieldspec.Normalize.Enum.NONE;
            // word implies lowercase (used for attributes)
            if (matching.getType() == MatchType.WORD) return VsmfieldsConfig.Fieldspec.Normalize.Enum.LOWERCASE;
            // Everything else
            return VsmfieldsConfig.Fieldspec.Normalize.LOWERCASE_AND_FOLD;
        }
Converts to the right index type from a field datatype
config-model/src/main/java/com/yahoo/schema/derived/VsmFields.java