private static void validateCluster(Context context, ContentSearchCluster cluster) {
        if ( ! cluster.hasSearchCluster()) return;

        List<String> fields = cluster.getSearchCluster()
                                     .schemas()
                                     .values()
                                     .stream()
                                     .map(HnswValidator::fieldsWithHnswIndex)
                                     .filter(Optional::isPresent)
                                     .map(Optional::get)
                                     .toList();
        if (fields.isEmpty()) return;

        var message = ("Cluster '%s' has searchable copies > 1 and fields with hnsw index:" +
                " %s." +
                " This will use a lot of resources, consider using searchable-copies=1%s")
                .formatted(cluster.getClusterName(),
                           String.join(", ", fields),
                           cluster.usesHierarchicDistribution()
                                   ? ""
                                   : " and going to a grouped setup, see https://docs.vespa.ai/en/elasticity.html#grouped-distribution");
        context.deployState()
               .getDeployLogger()
               .logApplicationPackage(INFO, message);
    }
Validates hnsw settings and warns if using hnsw and having searchable copies > 1 for a content cluster

@author hmusum
config-model/src/main/java/com/yahoo/vespa/model/application/validation/HnswValidator.java