private void ResetTdIndexSearcher() { lock (resetSearcherLock) { if (_tdIndexSearcher != null) { _tdIndexSearcher.Close(); _tdIndexSearcher = null; } } }
/** * @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; } }
public void Stop() { if (Searcher != null) { Searcher.Close(); Searcher = null; } IsStarted = false; if (timer != null) { timer.Dispose(); } cancellationTokenSource.Cancel(); }
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(); }