/// <summary>
        /// 在indexPath位置建立索引
        /// </summary>
        /// <param name="products">加入索引的产品集合</param>
        /// <param name="indexPath">索引所在路径</param>
        /// <returns></returns>
        public static bool Insert(List <Article> articles, string indexPath)
        {
            bool indexFileIsExist = GlobalSettings.CheckFileExist(indexPath);

            if (!indexFileIsExist)
            {
                try
                {
                    GlobalSettings.EnsureDirectoryExists(indexPath);
                }
                catch { }
            }
            return(Insert(articles, indexPath, !indexFileIsExist));
        }
Пример #2
0
        /// <summary>
        /// 在indexPath位置建立索引
        /// </summary>
        /// <param name="products">加入索引的产品集合</param>
        /// <param name="indexPath">索引所在路径</param>
        /// <returns></returns>
        public static bool Insert(List <Product> products, string indexPath)
        {
            bool indexFileIsExist = GlobalSettings.CheckFileExist(indexPath);

            if (!indexFileIsExist)
            {
                try
                {
                    GlobalSettings.EnsureDirectoryExists(indexPath);
                    //System.IO.Directory.CreateDirectory(indexPath);
                }
                catch { }
            }
            return(Insert(products, indexPath, !indexFileIsExist));
        }