我有一个ASP.NET MVC 4个网站托管在Windows Azure上。我需要在此网站进行全文搜索,所以我使用Lucene.NET。 Lucene使用Windows Azure Blob来存储索引文件。目前,查询需要很长时间(大约1分钟)。当我看着小提琴手,我注意到,285个请求被解雇掉的Blob存储。Lucene.NET使用Windows Azure
我Blob存储目前只中有10个文件。最大的文件只有177kb。我还注意到Dispose调用需要大约20秒。这是我的代码。我不觉得我在做任何事情太疯狂
IndexWriter indexWriter = InitializeSearchIndex();
if (indexWriter != null)
{
foreach (var result in cachedResults)
{
var document = new Document();
document.Add(new Field("Name", result.Name, Field.Store.YES, Field.Index.NOT_ANALYZED));
document.Add(new Field("ID", result.ID.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED));
document.Add(new Field("Description", result.Description, Field.Store.YES, Field.Index.NOT_ANALYZED));
document.Add(new Field("LastActivity", result.LastActivity, Field.Store.YES, Field.Index.NOT_ANALYZED));
indexWriter.AddDocument(document);
}
indexWriter.Dispose();
}
同时,我不知道为什么这要花这么长时间。
狮子座对Lucene的一个伟大的博客文章与SQL Azure的位置:http://leoncullens.nl/post/2012/11/ 18 /全文检索用的,天青与 - LuceneNET.aspx也许它可以帮助你吗?我有一个类似的实现,它闪电超过数百万条记录。 – ozz