Inheritance: AbstractSearch
Exemplo n.º 1
0
        private void PersistResults(DateTime startDate, DateTime endDate, IEnumerable <string> phrases)
        {
            var matchingFile  = new PersistanceManager.MatchingFile(_searchFile, _searchPhrase, 0, _matches);
            var matchingFiles = new List <PersistanceManager.MatchingFile>()
            {
                matchingFile
            };
            var processedFilesCount = 1u;

            var storedSearch = new PersistanceManager.Search(startDate, endDate, processedFilesCount, phrases, matchingFiles);

            // TODO: Remove magic db name string
            var persistanceManager = new PersistanceManager.SqLitePersistanceManager("db.s3db");

            persistanceManager.SaveSearch(storedSearch);
        }
Exemplo n.º 2
0
        internal void PersistResults(ISearchResult results, string dbPath)
        {
            var matchingFiles = new List <PersistanceManager.MatchingFile>(results.Searchees.Count());

            foreach (var hit in results.Searchees)
            {
                var info         = new FileInfo(hit.Searchee.Path);
                var matchingFile =
                    new PersistanceManager.MatchingFile(info.Name, hit.Searchee.Path, info.Length, hit.Matches);

                matchingFiles.Add(matchingFile);
            }

            var storedSearch = new PersistanceManager.Search(results.StartDate, results.EndDate,
                                                             (uint)results.ProcessedSearcheesCount, results.Phrases, matchingFiles);

            new PersistanceManager.SqLitePersistanceManager(dbPath).SaveSearch(storedSearch);
        }
Exemplo n.º 3
0
        internal void PersistResults(ISearchResult results, string dbPath)
        {
            var matchingFiles = new List<PersistanceManager.MatchingFile>(results.Searchees.Count());

            foreach (var hit in results.Searchees)
            {
                var info = new FileInfo(hit.Searchee.Path);
                var matchingFile =
                    new PersistanceManager.MatchingFile(info.Name, hit.Searchee.Path, info.Length, hit.Matches);

                matchingFiles.Add(matchingFile);
            }

            var storedSearch = new PersistanceManager.Search(results.StartDate, results.EndDate,
                (uint)results.ProcessedSearcheesCount, results.Phrases, matchingFiles);

            new PersistanceManager.SqLitePersistanceManager(dbPath).SaveSearch(storedSearch);
        }
Exemplo n.º 4
0
        private void PersistResults(DateTime startDate, DateTime endDate, IEnumerable<string> phrases)
        {
            var matchingFile = new PersistanceManager.MatchingFile(_searchFile, _searchPhrase, 0, _matches);
            var matchingFiles = new List<PersistanceManager.MatchingFile>() { matchingFile };
            var processedFilesCount = 1u;

            var storedSearch = new PersistanceManager.Search(startDate, endDate, processedFilesCount, phrases, matchingFiles);

            // TODO: Remove magic db name string
            var persistanceManager = new PersistanceManager.SqLitePersistanceManager("db.s3db");

            persistanceManager.SaveSearch(storedSearch);
        }