/**/
        /// <summary>
        /// 将数据库查询结果写入索引
        /// </summary>
        /// <param name="strSQL">数据库查询语句</param>
        /// <param name="mergeFactor">合并因子 (mergeFactor)</param>
        /// <param name="maxBufferedDocs">文档内存最大存储数</param>
        public override void WriteResultsWithEvent(string strSQL, int maxFieldLength, double ramBufferSize, int mergeFactor, int maxBufferedDocs, Dictionary<string, float> fieldBoostDict)
        {
            DBLinker linker;

            switch (dbType)
            {
                case DBTypeEnum.SQL_Server:
                    linker = new SqlServerLinker(_connectString);
                    break;
                case DBTypeEnum.OLE_DB:
                    linker = new OleDbLinker(_connectString);
                    break;
                case DBTypeEnum.ODBC:
                    linker = new OdbcLinker(_connectString);
                    break;
                case DBTypeEnum.Oracle:
                    linker = new OracleLinker(_connectString);
                    break;
                default:
                    linker = new SqlServerLinker(_connectString);
                    break;
            }
            DataTable dt = linker.ExecuteSQL(strSQL);
            DbWriterBase writer = new DBRamCreateIWriter(analyzer,dbName, _directory, maxFieldLength, ramBufferSize, mergeFactor, maxBufferedDocs);
            writer.OnProgressChanged += new WriteDbProgressChangedEventHandler(Writer_OnProgressChanged);
            writer.WriteDataTableWithEvent(dt,fieldBoostDict);
            linker.Close();
            IndexCompletedEventArgs args = new IndexCompletedEventArgs("CreateIndex");
            OnIndexCompletedEvent(this, args);
        }
        /**/
        /// <summary>
        /// 将数据库查询结果写入索引
        /// </summary>
        /// <param name="strSQL">数据库查询语句</param>
        /// <param name="mergeFactor">合并因子 (mergeFactor)</param>
        /// <param name="maxBufferedDocs">文档内存最大存储数</param>
        public override void WriteResultsWithEvent(string strSQL, int maxFieldLength, double ramBufferSize, int mergeFactor, int maxBufferedDocs)
        {
            DBLinker linker;

            switch (dbType)
            {
                case DBTypeEnum.SQL_Server:
                    linker = new SqlServerLinker(_connectString);
                    break;
                case DBTypeEnum.OLE_DB:
                    linker = new OleDbLinker(_connectString);
                    break;
                case DBTypeEnum.ODBC:
                    linker = new OdbcLinker(_connectString);
                    break;
                case DBTypeEnum.Oracle:
                    linker = new OracleLinker(_connectString);
                    break;
                default:
                    linker = new SqlServerLinker(_connectString);
                    break;
            }
            DataTable dt = linker.ExecuteSQL(strSQL);
            DbWriterBase writer = new DBRamCreateIWriter(analyzer,dbName, _directory, maxFieldLength, ramBufferSize, mergeFactor, maxBufferedDocs);
            writer.OnProgressChanged += new WriteDbProgressChangedEventHandler(Writer_OnProgressChanged);
            writer.WriteDataTableWithEvent(dt);
            linker.Close();
            IndexCompletedEventArgs args = new IndexCompletedEventArgs("CreateIndex");
            OnIndexCompletedEvent(this, args);
        }
 /**/
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="DBTypeEnum">合并因子 (mergeFactor)</param>
 /// <param name="maxBufferedDocs">文档内存最大存储数</param>
 public DBRamCreateIndexer(Analyzer analyzer, DBTypeEnum type, string connectString, string directory,string dbName)
     :base(dbName)
 {
     this.analyzer = analyzer;
     _connectString = connectString;
     _directory = directory;
 }
 #endregion
 #region Function
 /**/
 /// <summary>
 /// 将数据库查询结果写入索引
 /// </summary>
 /// <param name="strSQL">数据库查询语句</param>
 public override void WriteResults(string strSQL)
 {
     DBLinker linker;
    
     switch (dbType)
     {
         case DBTypeEnum.SQL_Server:
             linker=new SqlServerLinker(_connectString);
             break;
         case DBTypeEnum.OLE_DB:
             linker = new OleDbLinker(_connectString);
             break;
         case DBTypeEnum.ODBC:
             linker = new OdbcLinker(_connectString);
             break;
         case DBTypeEnum.Oracle:
             linker = new OracleLinker(_connectString);
             break;
         default:
             linker = new SqlServerLinker(_connectString);
             break;
     }
     DataTable dt = linker.ExecuteSQL(strSQL);
     DbWriterBase writer = new DBRamCreateIWriter(analyzer,dbName, _directory,int.MaxValue,512,1000,1000);
     writer.WriteDataTable(dt);
     linker.Close();
 }
        /**/
        /// <summary>
        /// 将数据库查询结果写入索引
        /// </summary>
        /// <param name="strSQL">数据库查询语句</param>
        /// <param name="mergeFactor">合并因子 (mergeFactor)</param>
        /// <param name="maxBufferedDocs">文档内存最大存储数</param>
        public override void WriteResults(string strSQL, int maxFieldLength, double ramBufferSize, int mergeFactor, int maxBufferedDocs)
        {
            DBLinker linker;
           
            switch (dbType)
            {
                case DBTypeEnum.SQL_Server:
                    linker=new SqlServerLinker(_connectString);
                    break;
                case DBTypeEnum.OLE_DB:
                    linker = new OleDbLinker(_connectString);
                    break;
                case DBTypeEnum.ODBC:
                    linker = new OdbcLinker(_connectString);
                    break;
                case DBTypeEnum.Oracle:
                    linker = new OracleLinker(_connectString);
                    break;
                default:
                    linker = new SqlServerLinker(_connectString);
                    break;
            }
            DataTable dt = linker.ExecuteSQL(strSQL);
            DbWriterBase writer = new DBRamCreateIWriter(analyzer,dbName, _directory,maxFieldLength,ramBufferSize,mergeFactor,maxBufferedDocs);
            writer.WriteDataTable(dt);
            linker.Close();
        }
        /**/
        /// <summary>
        /// 将数据库查询结果写入索引
        /// </summary>
        /// <param name="strSQL">数据库查询语句</param>
        /// <param name="mergeFactor">合并因子 (mergeFactor)</param>
        /// <param name="maxBufferedDocs">文档内存最大存储数</param>
        public override void WriteResults(string strSQL, int maxFieldLength, double ramBufferSize, int mergeFactor, int maxBufferedDocs, Dictionary<string, float> fieldBoostDict)
        {
            DBLinker linker;

            switch (dbType)
            {
                case DBTypeEnum.SQL_Server:
                    linker = new SqlServerLinker(_connectString);
                    break;
                case DBTypeEnum.OLE_DB:
                    linker = new OleDbLinker(_connectString);
                    break;
                case DBTypeEnum.ODBC:
                    linker = new OdbcLinker(_connectString);
                    break;
                case DBTypeEnum.Oracle:
                    linker = new OracleLinker(_connectString);
                    break;
                default:
                    linker = new SqlServerLinker(_connectString);
                    break;
            }
            DataTable dt = linker.ExecuteSQL(strSQL);
            DbWriterBase writer = new DBRamCreateIWriter(analyzer,dbName, _directory, maxFieldLength, ramBufferSize, mergeFactor, maxBufferedDocs);
            writer.WriteDataTable(dt,fieldBoostDict);
            linker.Close();
        }