static void Main(string[] args)
        {
            System.Console.WriteLine("Hello Lucene.Net");

            LuceneApplication        myLuceneApp = new LuceneApplication();
            List <PassageCollection> PassageList = new List <PassageCollection>();

            string indexPath = @"c:\temp\Week5Index";

            myLuceneApp.CreateIndex(indexPath);
            PassageList = myLuceneApp.JsonFileRead();
            System.Console.WriteLine("Adding Documents to Index");

            foreach (PassageCollection s in PassageList)
            {
                System.Console.WriteLine("Adding passage to Index");
                myLuceneApp.IndexText(s);
            }

            System.Console.WriteLine("All documents added.\n");

            // clean up
            myLuceneApp.CleanUpIndexer();


            myLuceneApp.CreateSearcher();
            myLuceneApp.CreateParser();

            // Activity 6
            myLuceneApp.DisplayResults(myLuceneApp.SearchIndex("\nhow long you need for "));


            myLuceneApp.CleanUpSearch();
            System.Console.ReadLine();
        }
        static void Main(string[] args)
        {
            LuceneApplication myLuceneApp = new LuceneApplication();

            // TODO: ADD PATHNAME
            string indexPath = @"C:\Users\n10104844\source\repos\IFN647-Practical\Practical 5\Week5_Index";

            myLuceneApp.CreateIndex(indexPath);

            System.Console.WriteLine("Adding Documents to Index");

            List <string> l = new List <string>();

            l.Add("The magical world of oz");
            l.Add("The mad, mad, mad, mad world");
            l.Add("Possum magic");

            foreach (string s in l)
            {
                System.Console.WriteLine("Adding " + s + "  to Index");
                myLuceneApp.IndexText(s);
            }

            System.Console.WriteLine("All documents added.");
            myLuceneApp.CreateParser();
            myLuceneApp.CreateSearcher();
            myLuceneApp.DisplayResult(myLuceneApp.SearchIndex("world"));
            // clean up
            myLuceneApp.CleanUpIndexer();
            myLuceneApp.CleanUpSearcher();


            System.Console.ReadLine();
        }
示例#3
0
        static void Main(string[] args)
        {
            System.Console.WriteLine("Hello Lucene.Net");

            LuceneApplication myLuceneApp = new LuceneApplication();

            myLuceneApp.OpenIndex("./index");
            myLuceneApp.CreateAnalyser();
            myLuceneApp.CreateWriter();

            myLuceneApp.IndexText("i love information retreval i love data science data scienctist is a dream job");
            myLuceneApp.CleanUp();
            System.Console.ReadLine();
        }
示例#4
0
        static void Main(string[] args)
        {
            System.Console.WriteLine("Hello Lucene.Net");
            LuceneApplication myLuceneApp = new LuceneApplication();
            string            path        = @"C:\Week3_Index";

            myLuceneApp.OpenIndex(path);
            myLuceneApp.CreateAnalyser();
            myLuceneApp.CreateWriter();
            myLuceneApp.IndexText("The little shining star");

            //After writing clean the stuffs
            myLuceneApp.CleanUp();
            System.Console.ReadLine();
        }
        static void Main(string[] args)
        {
            LuceneApplication myLuceneApp = new LuceneApplication();

            // TODO: ADD PATHNAME
            string indexPath = @"C:\Week_5";

            myLuceneApp.CreateIndex(indexPath);

            System.Console.WriteLine("Adding Documents to Index");

            List <string> l = new List <string>();

            l.Add("The magical world of oz");
            l.Add("The mad, mad, mad, mad world");
            l.Add("Possum magic");
            l.Add("Harry is a mad guy");

            foreach (string s in l)
            {
                System.Console.WriteLine("Adding " + s + "  to Index");
                myLuceneApp.IndexText(s);
            }

            System.Console.WriteLine("All documents added.");

            myLuceneApp.CreateSearcher();

            // clean up
            myLuceneApp.CleanUpIndexer();
            myLuceneApp.CreateParser();


            string  text = "guy";
            TopDocs td   = myLuceneApp.SearchIndex(text);

            Console.WriteLine($"Number of results is {td.TotalHits}");

            myLuceneApp.DisplayResults(td);

            myLuceneApp.CleanUpSearcher();

            System.Console.ReadLine();
        }
示例#6
0
        static void Main(string[] args)
        {
            string[] texts = { "The Daily Star", "The Daily Planet", "Daily News", "News of the Day", "New New York News" };


            System.Console.WriteLine("Hello Lucene.Net");


            LuceneApplication myLuceneApp = new LuceneApplication();
            string            dir         = @"H:\indexStores";

            myLuceneApp.OpenIndex(dir);
            myLuceneApp.CreateAnalyser();
            myLuceneApp.CreateWriter();
            myLuceneApp.IndexText(texts);
            myLuceneApp.CleanUp();



            System.Console.ReadLine();
        }
        static void Main(string[] args)
        {
            LuceneApplication myLuceneApp = new LuceneApplication();

            // TODO: ADD PATHNAME
            string indexPath = @"./index";

            myLuceneApp.CreateIndex(indexPath);

            System.Console.WriteLine("Adding Documents to Index");

            List <string> l = new List <string>();

            l.Add("The magical world of oz");
            l.Add("The mad, mad, mad, mad world");
            l.Add("Possum magic");

            foreach (string s in l)
            {
                System.Console.WriteLine("Adding " + s + "  to Index");
                myLuceneApp.IndexText(s);
            }

            System.Console.WriteLine("All documents added.");

            myLuceneApp.CreateSearcher();
            myLuceneApp.CreateParser();
            TopDocs doc = myLuceneApp.SearchIndex(TEXT_FN);

            myLuceneApp.DisplayResults(doc, l);
            // clean up
            myLuceneApp.CleanUpIndexer();
            myLuceneApp.CleanUpSearcher();

            System.Console.ReadLine();
        }