//----------------------------------------------------------------------------- public void activateIndex(string path) { LuceneInteractive myLuceneApp = new LuceneInteractive(); //List<IndividualCollection> collectionList = collectString(path); List <string> l = collectString(path); for (int i = 0; i < l.Count(); i++) { Console.WriteLine(l[i]); } // source collection //List<string> l = new List<string>(); //System.Console.WriteLine(collectionList.Count()); //for (int i =0;i< collectionList.Count(); i++) { // l.Add(collectionList[i].passage_text + collectionList[i].passage_ID); //} System.Console.WriteLine(l.Count()); // Index code IndexPath = @"C:\Users\wangh\OneDrive\桌面\IFN647_Assignment2\Week8\HsuanIndex"; // LuceneInteractive myLuceneApp = new LuceneInteractive(); DateTime Indexingstart = System.DateTime.Now; myLuceneApp.CreateIndex(IndexPath); foreach (string s in l) { myLuceneApp.IndexText(s); } myLuceneApp.CleanUpIndexer(); DateTime IndexingEnd = System.DateTime.Now; IndexingTime = (IndexingEnd - Indexingstart).ToString(); // myLuceneApp.CreateSearcher(); //return myLuceneApp.SearchAndDisplayResults(query); //myLuceneApp.CleanUpSearcher(); }
public GUIForm() { InitializeComponent(); p = new Poem(); index = new LuceneInteractive(); }