コード例 #1
0
ファイル: Program.cs プロジェクト: jenifers001d/testFor647
        //public static string SearchIndex_Click(string queryText, string indexPath)
        public static List <Dictionary <string, string> > SearchIndex_Click(string queryText, string indexPath)
        {
            LuceneIndexSearch mySearch = new LuceneIndexSearch();

            mySearch.CreateSearcher(indexPath);
            mySearch.CreateParser();
            return(mySearch.SearchIndext(queryText));
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: jenifers001d/testFor647
        public static void BuildIndex_Click(string sourcePath, string indexPath)
        {
            LuceneIndexSearch mySearch = new LuceneIndexSearch();
            DateTime          IndexS   = System.DateTime.Now; // [Time] Start creating index

            mySearch.CreateIndex(indexPath);
            mySearch.IndexText(sourcePath);
            mySearch.CleanUpIndexer();
            DateTime IndexF = System.DateTime.Now;   // [Time] Creating index is finished

            MessageBox.Show("This indexing process has completed in " + (IndexF - IndexS).TotalMilliseconds + " milliseconds", "Total Indexing Time", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: jenifers001d/testFor647
        public static string DisplayProcessedQueries(string queries)
        {
            LuceneIndexSearch mySearch = new LuceneIndexSearch();
            string            q        = mySearch.DisplayQueries(queries).ToString();

            string[] delimiters   = { "passage_text:", " passage_text:" };
            string[] finalQueries = q.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
            string   fQ           = "";

            foreach (string query in finalQueries)
            {
                fQ += query + ", ";
            }
            return(fQ);
        }