private void AddDocs(Directory dir, int ndocs, bool compound)
{
IndexWriter iw = new IndexWriter(dir, anlzr, false, IndexWriter.MaxFieldLength.LIMITED);
iw.SetMaxBufferedDocs(5);
iw.MergeFactor = 3;
iw.SetSimilarity(similarityOne);
iw.UseCompoundFile = compound;
for (int i = 0; i < ndocs; i++)
{
iw.AddDocument(NewDoc());
}
iw.Close();
}