private void BindTermDocs(Term term) { if (CurrentIndex.IsIndexBeOpend()) { IOpen open = CurrentIndex.GetCurrentOpendIndex(); TermDocumentsRelation tdr = new TermDocumentsRelation(open); docs = tdr.DocumentCount(term); label6.Text = string.Format("文档数:{0}", docs.Count); } }
public void UpdateUI() { if (CurrentIndex.IsIndexBeOpend()) { IndexOpen open = CurrentIndex.GetCurrentOpendIndex(); docNum = open.Reader.MaxDoc(); label1.Text = string.Format("共有文档{0}条", docNum); FieldTermsRelation rela = FieldTermsRelation.getInstance(); for (int i = 0; i < rela.Fields.Length; i++) { comboBox1.Items.Add(rela.Fields[i]); } if (comboBox1.Items.Count > 0) { comboBox1.SelectedIndex = 0; } } }
public void UpdateUI() { if (CurrentIndex.IsIndexBeOpend()) { IndexOpen open = CurrentIndex.GetCurrentOpendIndex(); GeneralBind bind = new GeneralBind(open); GeneralBind.ViewData data = bind.Execute(); IndexPath_Lab.Text += data.IndexPath; FieldNum_Ctl.Text += data.FieldNum; DocumentNum_Ctl.Text += data.DocumentNum; IndexOP_Ctl.Text += data.IsOptimized ? "已经优化" : "没有优化"; IndexVer_Ctl.Text += data.Version.ToString(); UpdateTime_Ctl.Text += data.UpdateTime.ToString(); listBox1.Items.Clear(); FieldTermsRelation rela = FieldTermsRelation.getInstance(); for (int i = 0; i < rela.Fields.Length; i++) { listBox1.Items.Add(rela.Fields[i]); } listBox1.Items.Insert(0, "所有Fields"); listBox1.SelectedIndex = 0; } }
private void ShowDocument(int docId) { listView1.Clear(); listView1.Columns.Add("Field", 120); listView1.Columns.Add("Norm", 120); listView1.Columns.Add("Text", 400); IOpen open = CurrentIndex.GetCurrentOpendIndex(); if (docId >= open.Reader.NumDocs()) { MessageHelper.ShowErrorMessage("当前Id超出文档最大Id。"); return; } Document doc = open.Reader.Document(docId); IList list = doc.GetFields(); for (int i = 0; i < list.Count; i++) { Field f = list[i] as Field; listView1.Items.Add(new ListViewItem(new string[] { f.Name(), TermDocumentsRelation.GetNorm(CurrentIndex.GetCurrentOpendIndex().Reader, f.Name(), docId).ToString(), f.StringValue() })); } }