Exemple #1
0
        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;
                }
            }
        }
Exemple #2
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;
     }
 }
Exemple #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            IndexOpen open = new IndexOpen(this.comboBox1.Text, false);

            Console.WriteLine(110);
            if (open.IndexExists())
            {
                bool isOpend = open.Open();
                if (isOpend)
                {
                    CurrentIndex.SetCurrentOpendIndex(open);
                    this.Close();
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageHelper.ShowErrorMessage("打开索引文件失败,有可能是索引文件损坏引起。");
                }
            }
            else
            {
                MessageHelper.ShowErrorMessage("索引文件不存在!");
            }
        }