public Log() { this.engConf = EngineConfiguration.Instance; this.separator = engConf.LogSeparator; this.separatorParameters = '#'; this.LogParameters = new List<string>(); }
EngineDisk() { this.engineConfiguration = EngineConfiguration.Instance; this.logRep = FactoryRepositoryLog.GetRepositoryLog(); maxSentence = engineConfiguration.MaxSentence; maxResultList = engineConfiguration.MaxResultList; this.indexer = FactoryIndexer.GetIndexer(); }
RankFunctionPivotedLengthNormVSM() { this.engConf = EngineConfiguration.Instance; this.docIndex = FactoryDocumentIndex.GetDocumentIndex(); this.s = engConf.SNormalizationfactor; this.totalDocQuantity = docIndex.GetQuantity(); this.avdl = docIndex.GetAverageDocumentLenght(); }
RankFunctionBM25_Okapi() { this.engConf = EngineConfiguration.Instance; this.docIndex = FactoryDocumentIndex.GetDocumentIndex(); this.b = engConf.BNormalizationfactor; this.k1 = engConf.BM25OkapiK1factor; this.k3 = engConf.BM25OkapiK3factor; this.totalDocQuantity = docIndex.GetQuantity(); this.avdl = docIndex.GetAverageDocumentLenght(); }
RankFunctionBM25() { this.engConf = EngineConfiguration.Instance; this.docIndex = FactoryDocumentIndex.GetDocumentIndex(); this.totalDocQuantity = docIndex.GetQuantity(); }
private string GetFileName(int wordID) { conf = EngineConfiguration.Instance; return conf.PathFolderIndex + @"\" + wordID.ToString() + ".ind"; }
private List<DocumentResult> Search(string query, ResultSearchModel model) { IRepositoryLog repLog = FactoryRepositoryLog.GetRepositoryLog(); engConf = EngineConfiguration.Instance; IEngine eng = FactoryEngine.GetEngine(); DateTime start; TimeSpan timeDif; Stopwatch sw; string smsSearch = "Search".PadRight(15); start = DateTime.Now; sw = Stopwatch.StartNew(); List<DocumentResult> result = eng.Search(query); sw.Stop(); timeDif = sw.Elapsed; Log entry = new Log(); entry.TaskDescription = smsSearch; entry.StartDateTime = start; entry.ExecutionTime = timeDif; entry.LogParameters = new List<string>(); entry.LogParameters.Add("sentence: " + query); entry.LogParameters.Add("totalDocFound: " + result.Count.ToString()); entry.LogParameters.Add("totalDocIndexed: " + eng.TotalDocumentQuantity.ToString()); entry.LogParameters.Add("RankTypeFunction: " + engConf.RankTypeFunction); if (model.start == 0) { repLog.Write(entry); } if (result.Count > 0) { if (model.start == 0) { WriteResultsToDisk(result, query); } foreach (DocumentResult item in result) { string physicalRepositoryPath = EngineConfiguration.Instance.PathFolderRepository; string virtualRepositoryParh = ConfigurationManager.AppSettings["pathVirtualRepository"] as string; string resultPath = item.File.Remove(0, physicalRepositoryPath.Length); resultPath = virtualRepositoryParh + resultPath.Replace("\\", "/"); resultPath = GetEncodedString(resultPath); string baseUrl = Request.Url.Scheme + "://" + Request.Url.Authority + Request.ApplicationPath.TrimEnd('/') + "/"; if (String.IsNullOrEmpty(item.Url)) { item.Url = baseUrl+ resultPath; } } } return result; }