@Override
    public void process(boolean validate, boolean documentsOnly) {
        if (!validate) return;

        String searchName = schema.getName();
        Map<String, DataType> seenFields = new HashMap<>();
        verifySearchAndDocFields(searchName, seenFields);
        verifySummaryFields(searchName, seenFields);
    }
@Test
    void throws_exception_if_type_of_document_field_does_not_match_summary_field() {
        Throwable exception = assertThrows(IllegalArgumentException.class, () -> {
            Schema schema = createSearchWithDocument(DOCUMENT_NAME);
            schema.setImportedFields(createSingleImportedField(IMPORTED_FIELD_NAME, DataType.INT));
            schema.addSummary(createDocumentSummary(IMPORTED_FIELD_NAME, DataType.STRING, schema));

            ValidateFieldTypes validator = new ValidateFieldTypes(schema, null, null, null);
            validator.process(true, false);
        });
        assertTrue(exception.getMessage().contains("For schema '" + DOCUMENT_NAME + "', field '" + IMPORTED_FIELD_NAME + "': Incompatible types. " +
                "Expected int for summary field '" + IMPORTED_FIELD_NAME + "', got string."));
    }