lucene.net 全文检索的问题

xue119 2011-05-19 10:39:20
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 秒之间

问一下,大家有没有什么办法能提高搜索效率? 急~~~~~~

...全文
212 回复 打赏 收藏 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
内容概要:本文围绕基于电感电容电流环PI与前馈补偿矩阵构造的跟网型储能变流器,开展dq坐标系下的阻抗理论建模与Simulink仿真对比研究。通过建立储能变流器在dq域的数学模型,设计包含电感电流内环、电容电流中间环和电压外环的多环控制结构,并引入前馈补偿矩阵以提升系统的动态响应能力和稳定性。在此基础上,采用小信号分析法推导系统的输出阻抗模型,构建完整的dq域阻抗理论框架,并利用Simulink平台搭建高保真仿真模型进行频域扫频验证,实现理论建模与仿真结果的精确对比,深入分析控制参数对系统阻抗特性的影响规律,揭示其在抑制并网系统振荡、提升稳定性方面的关键作用,为新能源并网系统的稳定性分析与优化设计提供坚实的理论支撑和技术路径。; 适合人群:具备电力电子、自动控制理论基础,从事新能源发电、储能系统、微电网或电力系统稳定性研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①掌握跟网型储能变流器在dq域的阻抗建模方法;②理解多环控制与前馈补偿对系统阻抗特性的影响机制;③实现理论阻抗模型与Simulink仿真扫频结果的对比验证,支撑并网稳定性分析。; 阅读建议:学习者应结合控制理论与电力电子变换器知识,重点关注数学推导与仿真建模的一致性,建议动手复现Simulink仿真模型并进行参数敏感性分析,以深化对阻抗重塑机理的理解。

25,979

社区成员

发帖
与我相关
我的任务
社区描述
高性能WEB开发
社区管理员
  • 高性能WEB开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧