Summary description for Explanation.
Inheritance: System.Windows.Forms.Form
Esempio n. 1
0
        private void btnExplain_Click(object sender, System.EventArgs e)
        {
            if (listSearch.SelectedItems.Count == 0)
            {
                return;
            }
            if (searchedDocIds == null || searchedDocIds.Length < listSearch.Items.Count)
            {
                return;
            }

            if (_luke.IndexReader == null)
            {
                _luke.ShowStatus(_luke.resources.GetString("NoIndex"));
                return;
            }

            if (query == null)
            {
                return;
            }

            IndexSearcher searcher = null;

            try
            {
                searcher = new IndexSearcher(_luke.Directory, true);
                Lucene.Net.Search.Explanation expl       = searcher.Explain(query, searchedDocIds[listSearch.SelectedIndices[0]]);
                ExplanationDialog             explDialog = new ExplanationDialog(expl);
                explDialog.ShowDialog(this);
            }
            catch (Exception exc)
            {
                _luke.ErrorMessage(exc.Message);
            }
            finally
            {
                searcher.Close();
            }
        }
Esempio n. 2
0
        private void btnExplain_Click(object sender, System.EventArgs e)
        {
            if (listSearch.SelectedItems.Count == 0) return;
            if (searchedDocIds == null || searchedDocIds.Length < listSearch.Items.Count) return;

            if (_luke.IndexReader == null)
            {
                _luke.ShowStatus(_luke.resources.GetString("NoIndex"));
                return;
            }

            if (query == null) return;

            IndexSearcher searcher = null;
            try
            {
                searcher = new IndexSearcher(_luke.Directory, true);
                Lucene.Net.Search.Explanation expl = searcher.Explain(query, searchedDocIds[listSearch.SelectedIndices[0]]);
                ExplanationDialog explDialog = new ExplanationDialog(expl);
                explDialog.ShowDialog(this);
            }
            catch (Exception exc)
            {
                _luke.ErrorMessage(exc.Message);
            }
            finally
            {
                searcher.Close();
            }
        }