static void convertSummaryFieldSettings(Schema schema, SummaryField summary, ParsedSummaryField parsed,
                                            String documentSummaryName) {
        var transform = SummaryTransform.NONE;
        var selectElementsBySummaryFeature = parsed.getSelectElementsBySummaryFeature();
        if (selectElementsBySummaryFeature.isPresent()) {
            if (parsed.getMatchedElementsOnly()) {
                throw new IllegalArgumentException("For schema '" + schema.getName() + "' document-summary '" +
                    documentSummaryName + "' summary field '" + summary.getName() + "': " +
                    "Both matched-elements-only and select-elements-by specified, this is not supported");
            }
            summary.setElementsSelector(SummaryElementsSelector.selectBySummaryFeature(selectElementsBySummaryFeature.get()));
        } else if (parsed.getMatchedElementsOnly()) {
            summary.setElementsSelector(SummaryElementsSelector.selectByMatch());
        }
        if (parsed.getDynamic()) {
            transform = SummaryTransform.DYNAMICTEASER;
        } else if (parsed.getTokens()) {
            transform = SummaryTransform.TOKENS;
        }
        if (parsed.getBolded()) {
            transform = transform.bold();
        }
        summary.setTransform(transform);
        for (String source : parsed.getSources()) {
            summary.addSource(source);
        }
        for (String destination : parsed.getDestinations()) {
            summary.addDestination(destination);
        }
        summary.setImplicit(false);
    }
Helper for converting ParsedField etc. to SDField with settings

@author arnej27959
config-model/src/main/java/com/yahoo/schema/parser/ConvertParsedFields.java