title: Lucene.NET with Windows Azure
body: <p>I have an ASP.NET MVC 4 site hosted on Windows Azure. I needed full text search in this site so I used Lucene.NET. Lucene is using a Windows Azure Blob to store the indexing files. Currently, a query takes a long time (approx. 1 min). When I look in Fiddler, I notice that 285 requests are fired off to the Blob storage.</p>
  
  <p>My Blob storage currently only has 10 files in it. The largest file is only 177kb. I also noticed that the Dispose call takes ~20 seconds. Here is my code. I don't feel like I'm doing anything too crazy</p>
  
  <pre><code>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();
  }
  </code></pre>
  
  <p>At the same time, I'm not sure why this is taking so long.</p>