private void ResetTdIndexSearcher()
 {
     lock (resetSearcherLock)
     {
         if (_tdIndexSearcher != null)
         {
             _tdIndexSearcher.Close();
             _tdIndexSearcher = null;
         }
     }
 }
Exemple #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;
     }
 }
Exemple #3
0
        public void Stop()
        {
            if (Searcher != null)
            {
                Searcher.Close();
                Searcher = null;
            }

            IsStarted = false;

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

            cancellationTokenSource.Cancel();
        }
Exemple #4
0
 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();
 }