private void checkMatching(Schema schema, FieldSet fieldSet) {
        Matching matching = fieldSet.getMatching();
        for (String fieldName : fieldSet.getFieldNames()) {
            ImmutableSDField field = schema.getField(fieldName);
            Matching fieldMatching = field.getMatching();
            if (matching == null) {
                matching = fieldMatching;
            } else {
                if ( ! matching.equals(fieldMatching)) {
                    final var buf = new StringBuilder();
                    buf.append("For schema '").append(schema.getName()).append("': ");
                    buf.append("The matching settings in ").append(fieldSet);
                    buf.append(" are inconsistent (explicitly or because of field type). ");
                    buf.append("This may lead to recall and ranking issues. ");
                    Matching original = fieldSet.getMatching();
                    if (original == null) {
                        buf.append("The fieldset will use matching TEXT. ");
                    } else {
                        buf.append("The fieldset will use matching ").append(original.getType()).append(". ");
                    }
                    var list = fieldSet.getFieldNames().stream()
                            .map(name -> schema.getField(name))
                            .filter(f -> (f != null))
                            .filter(f -> (f.getMatching() != null))
                            .map(f -> " Field '" + f.asField().getName() + "' has matching " + f.getMatching().getType())
                            .toList();
                    buf.append(list);
                    buf.append(" See ").append(fieldSetDocUrl);
                    deployLogger.logApplicationPackage(Level.WARNING, buf.toString());
                    // TODO: Remove (see FieldSetSettingsTestCase#inconsistentMatchingShouldStillSetMatchingForFieldSet)
                    // but when doing so matching for a fieldset might change
                    return;
                }
            }
        }
        fieldSet.setMatching(matching); // Assign the uniquely determined matching to the field set
    }
Computes the right "index commands" for each fieldset in a search definition.

@author vegardh
@author bratseth
config-model/src/main/java/com/yahoo/schema/processing/FieldSetSettings.java