private void ResetTdIndexSearcher()
 {
     lock (resetSearcherLock)
     {
         if (_tdIndexSearcher != null)
         {
             _tdIndexSearcher.Close();
             _tdIndexSearcher = null;
         }
     }
 }
예제 #2
0
 /**
  * @throws IOException
  */
 private void CloseReader()
 {
     if (searcher != null)
     {
         log.Info("Closing searcher for " + mydbname);
         searcher.Close();
         searcher = null;
     }
     if (reader != null)
     {
         log.Info("Closing reader for " + mydbname);
         reader.Close();
         reader = null;
     }
 }
예제 #3
0
        public void Stop()
        {
            if (Searcher != null)
            {
                Searcher.Close();
                Searcher = null;
            }

            IsStarted = false;

            if (timer != null)
            {
                timer.Dispose();
            }

            cancellationTokenSource.Cancel();
        }
예제 #4
0
파일: Form1.cs 프로젝트: usmanghani/Misc
 private void button4_Click(object sender, EventArgs e)
 {
     listBox1.Items.Clear();
     Searcher isearcher = new Searcher(_indexTarget);
     string [] docs = isearcher.SearchDocs(textBox2.Text);
     label1.Text = docs.Length.ToString() + " hit(s).";
     listBox1.Items.AddRange(docs);
     isearcher.Close();
 }