static void Main(string[] args)
{
//Analyzer analyzer = new StandardAnalyzer();
Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_23);
Directory directory = null;
//directory.CreateOutput(@"D:\workspace\C#\lucene\lucene\lucene\IndexDirectory");
while (true)
{
Console.Write("id:");
string id = Console.ReadLine().ToString();
Console.Write("title:");
string title = Console.ReadLine().ToString();
Console.Write("content:");
string content = Console.ReadLine().ToString();
Console.WriteLine("=================================");
string indexPath = @"D:\workspace\C#\lucene\lucene\lucene\IndexDirectory";
directory = FSDirectory.Open(new System.IO.DirectoryInfo(indexPath));
IndexWriter writer = new IndexWriter(directory, analyzer, true, IndexWriter.MaxFieldLength.UNLIMITED);
AddDocument(writer, id, title, content);
writer.Optimize();
writer.Dispose();
}
//AddDocument(writer,"1","name","ada");
//AddDocument(writer, "2","SQL Server 2008 的发布ada", "SQL Server 2008 的新特性");
//AddDocument(writer, "3","ASP.Net MVC框架配置与分析", "而今,微软推出了新的MVC开发框架,也就是Microsoft ASP.NET 3.5 Extensions");
}