code: void setUseCompoundFile(boolean b)
     {
        useCompoundFile = b;
        if (indexWriter != null)
        {
           IndexWriterConfig config = indexWriter.getConfig();
           if (config.getMergePolicy() instanceof LogMergePolicy)
           {
              ((LogMergePolicy)config.getMergePolicy()).setUseCompoundFile(useCompoundFile);
              ((LogMergePolicy)config.getMergePolicy()).setNoCFSRatio(1.0);
           }
           else if (config.getMergePolicy() instanceof TieredMergePolicy)
           {
              ((TieredMergePolicy)config.getMergePolicy()).setUseCompoundFile(useCompoundFile);
              ((TieredMergePolicy)config.getMergePolicy()).setNoCFSRatio(1.0);
           }
           else
           {
              log.error("Can't set \"UseCompoundFile\". Merge policy is not an instance of LogMergePolicy. ");
           }
        }
     }
docs: The lucene index writer property: useCompountFile