@SuppressWarnings("deprecation") public SolrIndexConfig(SolrConfig solrConfig,String prefix,SolrIndexConfig def){
  if (prefix == null) {
    prefix="indexConfig";
    log.debug("Defaulting to prefix \"" + prefix + "\" for index configuration");
  }
  if (def == null) {
    def=new SolrIndexConfig(solrConfig);
  }
  Object unused=solrConfig.getNode(prefix,false);
  luceneVersion=solrConfig.luceneMatchVersion;
  assertWarnOrFail("The <mergeScheduler>myclass</mergeScheduler> syntax is no longer supported in solrconfig.xml. Please use syntax <mergeScheduler class=\"myclass\"/> instead.",!((solrConfig.getNode(prefix + "/mergeScheduler",false) != null) && (solrConfig.get(prefix + "/mergeScheduler/@class",null) == null)),true);
  assertWarnOrFail("The <mergePolicy>myclass</mergePolicy> syntax is no longer supported in solrconfig.xml. Please use syntax <mergePolicy class=\"myclass\"/> instead.",!((solrConfig.getNode(prefix + "/mergePolicy",false) != null) && (solrConfig.get(prefix + "/mergePolicy/@class",null) == null)),true);
  assertWarnOrFail("The <luceneAutoCommit>true|false</luceneAutoCommit> parameter is no longer valid in solrconfig.xml.",solrConfig.get(prefix + "/luceneAutoCommit",null) == null,true);
  defaultMergePolicyClassName=def.defaultMergePolicyClassName;
  useCompoundFile=solrConfig.getBool(prefix + "/useCompoundFile",def.useCompoundFile);
  effectiveUseCompountFileSetting=useCompoundFile;
  maxBufferedDocs=solrConfig.getInt(prefix + "/maxBufferedDocs",def.maxBufferedDocs);
  maxMergeDocs=solrConfig.getInt(prefix + "/maxMergeDocs",def.maxMergeDocs);
  maxIndexingThreads=solrConfig.getInt(prefix + "/maxIndexingThreads",def.maxIndexingThreads);
  mergeFactor=solrConfig.getInt(prefix + "/mergeFactor",def.mergeFactor);
  ramBufferSizeMB=solrConfig.getDouble(prefix + "/ramBufferSizeMB",def.ramBufferSizeMB);
  writeLockTimeout=solrConfig.getInt(prefix + "/writeLockTimeout",def.writeLockTimeout);
  lockType=solrConfig.get(prefix + "/lockType",def.lockType);
  mergeSchedulerInfo=getPluginInfo(prefix + "/mergeScheduler",solrConfig,def.mergeSchedulerInfo);
  mergePolicyInfo=getPluginInfo(prefix + "/mergePolicy",solrConfig,def.mergePolicyInfo);
  termIndexInterval=solrConfig.getInt(prefix + "/termIndexInterval",def.termIndexInterval);
  boolean infoStreamEnabled=solrConfig.getBool(prefix + "/infoStream",false);
  if (infoStreamEnabled) {
    String infoStreamFile=solrConfig.get(prefix + "/infoStream/@file",null);
    if (infoStreamFile == null) {
      log.info("IndexWriter infoStream solr logging is enabled");
      infoStream=new LoggingInfoStream();
    }
 else {
      log.warn("IndexWriter infoStream file log is enabled: " + infoStreamFile + "\nThis feature is deprecated. Remove @file from <infoStream> to output messages to solr's logfile");
      File f=new File(infoStreamFile);
      File parent=f.getParentFile();
      if (parent != null)       parent.mkdirs();
      try {
        FileOutputStream fos=new FileOutputStream(f,true);
        infoStream=new PrintStreamInfoStream(new PrintStream(fos,true,"UTF-8"));
      }
 catch (      Exception e) {
        log.error("Could not create info stream for file " + infoStreamFile,e);
      }
    }
  }
  mergedSegmentWarmerInfo=getPluginInfo(prefix + "/mergedSegmentWarmer",solrConfig,def.mergedSegmentWarmerInfo);
  if (mergedSegmentWarmerInfo != null && solrConfig.nrtMode == false) {
    throw new IllegalArgumentException("Supplying a mergedSegmentWarmer will do nothing since nrtMode is false");
  }
  checkIntegrityAtMerge=solrConfig.getBool(prefix + "/checkIntegrityAtMerge",def.checkIntegrityAtMerge);
}

@ SuppressWarnings ( "deprecation" ) public SolrIndexConfig ( SolrConfig solrConfig , String prefix , SolrIndexConfig def ) { if ( prefix == null ) { prefix = "indexConfig" ; log . debug ( "Defaulting to prefix \"" + prefix + "\" for index configuration" ) ; } if ( def == null ) { def = new SolrIndexConfig ( solrConfig ) ; } Object unused = solrConfig . getNode ( prefix , false ) ; luceneVersion = solrConfig . luceneMatchVersion ; assertWarnOrFail ( "The <mergeScheduler>myclass</mergeScheduler> syntax is no longer supported in solrconfig.xml. Please use syntax <mergeScheduler class=\"myclass\"/> instead." , ! ( ( solrConfig . getNode ( prefix + "/mergeScheduler" , false ) != null ) && ( solrConfig . get ( prefix + "/mergeScheduler/@class" , null ) == null ) ) , true ) ; assertWarnOrFail ( "The <mergePolicy>myclass</mergePolicy> syntax is no longer supported in solrconfig.xml. Please use syntax <mergePolicy class=\"myclass\"/> instead." , ! ( ( solrConfig . getNode ( prefix + "/mergePolicy" , false ) != null ) && ( solrConfig . get ( prefix + "/mergePolicy/@class" , null ) == null ) ) , true ) ; assertWarnOrFail ( "The <luceneAutoCommit>true|false</luceneAutoCommit> parameter is no longer valid in solrconfig.xml." , solrConfig . get ( prefix + "/luceneAutoCommit" , null ) == null , true ) ; defaultMergePolicyClassName = def . defaultMergePolicyClassName ; useCompoundFile = solrConfig . getBool ( prefix + "/useCompoundFile" , def . useCompoundFile ) ; effectiveUseCompountFileSetting = useCompoundFile ; maxBufferedDocs = solrConfig . getInt ( prefix + "/maxBufferedDocs" , def . maxBufferedDocs ) ; maxMergeDocs = solrConfig . getInt ( prefix + "/maxMergeDocs" , def . maxMergeDocs ) ; maxIndexingThreads = solrConfig . getInt ( prefix + "/maxIndexingThreads" , def . maxIndexingThreads ) ; mergeFactor = solrConfig . getInt ( prefix + "/mergeFactor" , def . mergeFactor ) ; ramBufferSizeMB = solrConfig . getDouble ( prefix + "/ramBufferSizeMB" , def . ramBufferSizeMB ) ; writeLockTimeout = solrConfig . getInt ( prefix + "/writeLockTimeout" , def . writeLockTimeout ) ; lockType = solrConfig . get ( prefix + "/lockType" , def . lockType ) ; mergeSchedulerInfo = getPluginInfo ( prefix + "/mergeScheduler" , solrConfig , def . mergeSchedulerInfo ) ; mergePolicyInfo = getPluginInfo ( prefix + "/mergePolicy" , solrConfig , def . mergePolicyInfo ) ; termIndexInterval = solrConfig . getInt ( prefix + "/termIndexInterval" , def . termIndexInterval ) ; boolean infoStreamEnabled = solrConfig . getBool ( prefix + "/infoStream" , false ) ; if ( infoStreamEnabled ) { String infoStreamFile = solrConfig . get ( prefix + "/infoStream/@file" , null ) ; if ( infoStreamFile == null ) { log . info ( "IndexWriter infoStream solr logging is enabled" ) ; infoStream = new LoggingInfoStream ( ) ; } else { log . warn ( "IndexWriter infoStream file log is enabled: " + infoStreamFile + "\nThis feature is deprecated. Remove @file from <infoStream> to output messages to solr's logfile" ) ; File f = new File ( infoStreamFile ) ; File parent = f . getParentFile ( ) ; if ( parent != null ) parent . mkdirs ( ) ; try { FileOutputStream fos = new FileOutputStream ( f , true ) ; infoStream = new PrintStreamInfoStream ( new PrintStream ( fos , true , "UTF-8" ) ) ; } catch ( Exception e ) { log . error ( "Could not create info stream for file " + infoStreamFile , e ) ; } } } mergedSegmentWarmerInfo = getPluginInfo ( prefix + "/mergedSegmentWarmer" , solrConfig , def . mergedSegmentWarmerInfo ) ; if ( mergedSegmentWarmerInfo != null && solrConfig . nrtMode == false ) { throw new IllegalArgumentException ( "Supplying a mergedSegmentWarmer will do nothing since nrtMode is false" ) ; } checkIntegrityAtMerge = solrConfig . getBool ( prefix + "/checkIntegrityAtMerge" , def . checkIntegrityAtMerge ) ; }
constructs a solrindexconfig which parses the lucene related config params in solrconfig . xml
