Exemplo n.º 1
0
        /// <summary>
        /// 索引文档
        /// </summary>
        /// <param name="indexDir">索引目录</param>
        /// <param name="info">商品对象</param>
        /// <returns></returns>
        public int IndexString(DataRow info, JXSearchType t)
        {
            switch (t)
            {
            case JXSearchType.Product:
                writer.AddDocument(CreateDocument(info));
                break;

            default:
                writer.AddDocument(CreateKeywordDocument(info));
                break;
            }
            int num = writer.NumDocs();

            return(num);
        }
        public static JXSearchProvider CreateProvider(JXSearchType t)
        {
            JXSearchProvider provider = null;

            switch (t)
            {
            case JXSearchType.Product:
                provider = new ProductSearchProvider();
                break;

            default:
                provider = new KeywordSearchProvider();
                break;
            }
            return(provider);
        }