private void processSummaryField(DocumentSummary summary, SummaryField field, boolean validate) {
        var sourceField = schema.getField(field.getSingleSource());
        if (sourceField != null) {
            if (!isSupportedComplexField(sourceField) && !isSupportedMultiValueField(sourceField) && validate) {
                String selectMsg = "matched-elements-only";
                if (field.getElementsSelector().getSelect() == SummaryElementsSelector.Select.BY_SUMMARY_FEATURE) {
                    selectMsg = "select-elements-by";
                }
                fail(summary, field, "'" + selectMsg + "' is not supported for this field type. " +
                        "Supported field types are: array of primitive, weighted set of primitive, " +
                        "array of simple struct, map of primitive type to simple struct, " +
                        "and map of primitive type to primitive type");
            }
        }
        // else case is handled in SummaryFieldsMustHaveValidSource
    }
Iterates all summary fields with 'matched-elements-only' or 'select-elements-by' and validates that the field type is supported.

@author geirst
config-model/src/main/java/com/yahoo/schema/processing/SummaryElementsSelectorValidator.java