[急]lucene.net 全文检索的问题
1. 建立索引到下面各个目录A 目录 (1.39GB)
B 目录 (70.8MB)
C 目录 (10.2MB)
D 目录 (325MB)
E 目录 (7.21MB)
F 目录 (21.3MB)
2. 搜索单个目录时 耗时 2~4 秒之间
代码如下
System.IO.DirectoryInfo[] DirInfos = new DirectoryInfo[6];
Lucene.Net.Search.IndexSearcher []Searcher = new IndexSearcher[6];
String key = String.Empty;
DirInfos[0] = new DirectoryInfo(System.Configuration.ConfigurationManager.AppSettings["A"]);
DirInfos[1] = new DirectoryInfo(System.Configuration.ConfigurationManager.AppSettings["B"]);
DirInfos[2] = new DirectoryInfo(System.Configuration.ConfigurationManager.AppSettings["C"]);
DirInfos[3] = new DirectoryInfo(System.Configuration.ConfigurationManager.AppSettings["C"]);
DirInfos[4] = new DirectoryInfo(System.Configuration.ConfigurationManager.AppSettings["E"]);
DirInfos[5] = new DirectoryInfo(System.Configuration.ConfigurationManager.AppSettings["F"]);
Lucene.Net.Store.Directory IndexDir = Lucene.Net.Store.FSDirectory.Open(DirInfos[0]);
Searcher[0] = new IndexSearcher(IndexDir, true);
IndexDir = Lucene.Net.Store.FSDirectory.Open(DirInfos[1]);
Searcher[1] = new IndexSearcher(IndexDir, true);
IndexDir = Lucene.Net.Store.FSDirectory.Open(DirInfos[2]);
Searcher[2] = new IndexSearcher(IndexDir, true);
IndexDir = Lucene.Net.Store.FSDirectory.Open(DirInfos[3]);
Searcher[3] = new IndexSearcher(IndexDir, true);
IndexDir = Lucene.Net.Store.FSDirectory.Open(DirInfos[4]);
Searcher[4] = new IndexSearcher(IndexDir, true);
IndexDir = Lucene.Net.Store.FSDirectory.Open(DirInfos[5]);
Searcher[5] = new IndexSearcher(IndexDir, true);
MultiSearcher ms = new MultiSearcher(Searcher);
Analyzer WordBreaker = new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29);
//Sort sort = new Sort(new SortField("PublishDate", SortField.DOC, false));
String[] keywords={"中国","中国","中国"};
String[] fields ={"Title","Summary","Content"};
BooleanClause.Occur[] clause ={BooleanClause.Occur.SHOULD,BooleanClause.Occur.SHOULD,BooleanClause.Occur.SHOULD};
Query QueryResult = MultiFieldQueryParser.Parse(Lucene.Net.Util.Version.LUCENE_29, keywords, fields, clause, WordBreaker);
DateTime now = DateTime.Now;
//得到ScoreDoc数组
sc = ms.Search(QueryResult, 9999999).scoreDocs;
这段代码耗时达 18~ 25 秒之间
问一下,大家有没有什么办法能提高搜索效率? 急~~~~~~
补充:.NET技术 , C#