private static ApplicationBuilder createFromDirectory(String dir,
                                                          ApplicationPackage applicationPackage,
                                                          FileRegistry fileRegistry,
                                                          DeployLogger deployLogger,
                                                          ModelContext.Properties properties,
                                                          RankProfileRegistry rankProfileRegistry,
                                                          QueryProfileRegistry queryProfileRegistry) throws IOException, ParseException {
        ApplicationBuilder builder = new ApplicationBuilder(applicationPackage,
                                                            fileRegistry,
                                                            deployLogger,
                                                            properties,
                                                            rankProfileRegistry,
                                                            queryProfileRegistry);

        var fnli = Files.list(new File(dir).toPath())
            .map(java.nio.file.Path::toString)
            .filter(AbstractApplicationPackage::validSchemaFilename)
            .sorted();
        for (var i = fnli.iterator(); i.hasNext(); ) {
            builder.addSchemaFile(i.next());
        }
        builder.build(true);
        return builder;
    }
Convenience factory method to create a SearchBuilder from multiple SD files.
config-model/src/main/java/com/yahoo/schema/ApplicationBuilder.java