Esempio n. 1
0
        private static void CreateBOWModel(string dir, string collectionName, int skip, int take)
        {
            var files = Directory.GetFiles(dir, "*.docs");
            var time  = Stopwatch.StartNew();

            using (var sessionFactory = new SessionFactory(dir, new LatinTokenizer(), new IniConfiguration("sir.ini")))
            {
                using (var documentStreamSession = sessionFactory.CreateDocumentStreamSession(collectionName, collectionName.ToHash()))
                    using (var bowSession = sessionFactory.CreateBOWSession(collectionName, collectionName.ToHash()))
                    {
                        bowSession.Write(documentStreamSession.ReadDocs(skip, take), 0, 1, 2, 3, 6);
                    }
            }

            Logging.Log(null, string.Format("{0} BOW operation took {1}", collectionName, time.Elapsed));
        }