private void CreateDir(Directory dir) { IndexWriter writer = CreateWriter(dir); writer.AddDocument(CreateDoc()); writer.Dispose(); }