Esempio n. 1
0
        static void Main(string[] args)
        {
            var se = new SercherServerBase();

            try
            {
                se.BuildSercherIndexToSQLDB();
                Console.ReadKey();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            //   se.Searcher("深入人心的探讨").ToList()
            ////        .ForEach(x => {
            //             Console.WriteLine(x.doc.Name);
            //          });
        }
Esempio n. 2
0
        public void TestIndex()
        {
            Config.Init(true);
            foreach (var path in Directory.GetFiles(@"C:\Users\yjdcb\Desktop\temp", "*.*", SearchOption.AllDirectories)
                     .Where(x => x.LastIndexOf(".txt") != -1 ||
                            x.LastIndexOf(".doc") != -1 ||
                            x.LastIndexOf(".xls") != -1 ||
                            x.LastIndexOf(".xhtml") != -1
                            ))
            {
                (new DocumentDB {
                    DbName = "mydb", Ip = "WIN-T9ASCBISP3P\\MYSQL"
                }).UploadDocument(new Document()
                {
                    hasIndexed = "no", Name = new FileInfo(path).Name, Url = path
                });
            }

            var se = new SercherServerBase();

            se.BuildSercherIndexToSQLDB();
        }