docs: private SolrServer initCore(String core) {
          boolean isEmbedded = globalConfig.getBoolean(false, "indexer", core,
                  "embedded");
          try {
              // Embedded Solr
              if (isEmbedded) {
                  // Solr over HTTP - Needed to run commits
                  // so the core web server sees them.
                  String uri = globalConfig.getString(null, "indexer", core,
                          "uri");
                  if (uri == null) {
                      log.error("No URI provided for core: '{}'", core);
                      return null;
                  }
                  URI solrUri = new URI(uri);
                  commit = new CommonsHttpSolrServer(solrUri.toURL());
                  username = globalConfig.getString(null, "indexer", core,
                          "username");
                  password = globalConfig.getString(null, "indexer", core,
                          "password");
                  if (username != null && password != null) {
                      UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(
                              username, password);
                      HttpClient hc = ((CommonsHttpSolrServer) solr)
                              .getHttpClient();
                      hc.getParams().setAuthenticationPreemptive(true);
                      hc.getState().setCredentials(AuthScope.ANY, credentials);
                  }
  
                  // First time execution
                  if (coreContainer == null) {
                      String home = globalConfig.getString(DEFAULT_SOLR_HOME,
                              "indexer", "home");
                      log.info("Embedded Solr Home = {}", home);
                      File homeDir = new File(home);
                      if (!homeDir.exists()) {
                          log.error("Solr directory does not exist!");
                          return null;
                      }
                      System.setProperty("solr.solr.home",
                              homeDir.getAbsolutePath());
                      File coreXmlFile = new File(homeDir, "solr.xml");
                      coreContainer = new CoreContainer(
                              homeDir.getAbsolutePath(), coreXmlFile);
                      for (SolrCore aCore : coreContainer.getCores()) {
                          log.info("Loaded core: {}", aCore.getName());
                      }
                  }
                  String coreName = globalConfig.getString(null, "indexer", core,
                          "coreName");
                  if (coreName == null) {
                      log.error("No 'coreName' node for core: '{}'", core);
                      return null;
                  }
                  return new EmbeddedSolrServer(coreContainer, coreName);
  
                  // Solr over HTTP
              } else {
                  String uri = globalConfig.getString(null, "indexer", core,
                          "uri");
                  if (uri == null) {
                      log.error("No URI provided for core: '{}'", core);
                      return null;
                  }
  
                  URI solrUri = new URI(uri);
                  CommonsHttpSolrServer thisCore = new CommonsHttpSolrServer(
                          solrUri.toURL());
                  username = globalConfig.getString(null, "indexer", core,
                          "username");
                  password = globalConfig.getString(null, "indexer", core,
                          "password");
                  if (username != null && password != null) {
                      UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(
                              username, password);
                      HttpClient hc = thisCore.getHttpClient();
                      hc.getParams().setAuthenticationPreemptive(true);
                      hc.getState().setCredentials(AuthScope.ANY, credentials);
                  }
                  return thisCore;
              }
  
          } catch (MalformedURLException mue) {
              log.error(core + " : Malformed URL", mue);
          } catch (URISyntaxException urise) {
              log.error(core + " : Invalid URI", urise);
          } catch (IOException ioe) {
              log.error(core + " : Failed to read Solr configuration", ioe);
          } catch (ParserConfigurationException pce) {
              log.error(core + " : Failed to parse Solr configuration", pce);
          } catch (SAXException saxe) {
              log.error(core + " : Failed to load Solr configuration", saxe);
          }
          return null;
      }