private void disallowIndexingOfUnsupportedDataTypes(Context context, SearchCluster cluster, Schema schema, Field field)
    {
        var fieldType = field.getDataType();
        var nestedFieldType = fieldType;
        if (fieldType instanceof CollectionDataType collectionDataType) {
            nestedFieldType = collectionDataType.getNestedType();
        }
        if (!(nestedFieldType.equals(DataType.STRING) || nestedFieldType.equals(DataType.URI) ||
                (fieldType instanceof TensorDataType)) &&
                ((SDField) field).doesIndexing()) {
            context.deployState().getDeployLogger().logApplicationPackage(Level.WARNING, "In cluster '" + cluster.getClusterName() +
                    "', schema '" + schema.getName() + "', field '" + field.getName() + "': Field type '" + field.getDataType().getName() +
                    "' cannot be indexed");
        }
    }
This Validator iterates through all search cluster in the given VespaModel to make sure that there are no custom
structs defined in any of its search definitions.

@author Simon Thoresen Hult
config-model/src/main/java/com/yahoo/vespa/model/application/validation/SearchDataTypeValidator.java