// TODO: only time inverted search to be enabled for Lite // lexicon and postings based search later public bool Execute(SearchResults results, SearchResultsInfo info) { bool ret = false; foreach (var result in results.Results) { Console.WriteLine(string.Format("{0}", result.Raw)); } ret = true; return ret; }
static void Main(string[] args) { // sample end to end invocation var input = new FileInputProcessor(); var data = input.CreateInputPipelineData(); if (input.Execute(data)) { var db = Directory.EnumerateFiles(Environment.CurrentDirectory).FirstOrDefault(x => x.Contains(DateTime.Now.Day.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Year.ToString())); if (db == null) return; using (var reader = new StreamReader(db)) { var results = new SearchResults(); results.Results = new List<SearchResult>(); reader.ReadToEnd().Split(new char[] { '\n' }).ToList().ForEach(x => { var result = new SearchResult(); result.Raw = x; results.Results.Add(result); }); var info = new SearchResultsInfo(); var search = new SearchProcessor(); search.Execute(results, info); } } }