public void Init() { var files = Directory.GetFiles(string.Format("{0}/Config/Buffer/", AppDomain.CurrentDomain.BaseDirectory), "HotWordBuffer*"); foreach (var file in files) { var buffername = file.Substring(file.LastIndexOf("/") + 1).Replace(".boxcache", ""); var pindex = int.Parse(buffername.Replace("HotWordBuffer", "")); var node = new LuceneQueue(buffername); node.Init(); _dic[pindex] = node; } }
public void Init() { var files = Directory.GetFiles(string.Format("{0}/Config/Buffer/", AppDomain.CurrentDomain.BaseDirectory), "HotWordBuffer*"); foreach (var file in files) { var buffername = file.Substring(file.LastIndexOf("/") + 1).Replace(".boxcache", ""); var pindex = int.Parse(buffername.Replace("HotWordBuffer", "")); var node = new LuceneQueue(buffername); node.Init(); _dic[pindex] = node; } }
public bool AddNode(string key, int hitCount, int searchCount, string pIdex) { try { var index = int.Parse(pIdex); if (!_dic.ContainsKey(index)) { var node = new LuceneQueue(LuceneNetUtils.FormatStrArray(16, "HotWordBuffer", pIdex)); node.Init(); _dic[index] = node; } return _dic[index].AddNode(key, hitCount, pIdex, searchCount); } catch { return false; } }
public bool AddNode(string key, int hitCount, int searchCount, string pIdex) { try { var index = int.Parse(pIdex); if (!_dic.ContainsKey(index)) { var node = new LuceneQueue(LuceneNetUtils.FormatStrArray(16, "HotWordBuffer", pIdex)); node.Init(); _dic[index] = node; } return(_dic[index].AddNode(key, hitCount, pIdex, searchCount)); } catch { return(false); } }