Lucene.Net.Index.TestSnapshotDeletionPolicy.PrepareIndexAndSnapshots C# (CSharp) Method

PrepareIndexAndSnapshots() protected method

protected PrepareIndexAndSnapshots ( Lucene.Net.Index.SnapshotDeletionPolicy sdp, IndexWriter writer, int numSnapshots ) : void
sdp Lucene.Net.Index.SnapshotDeletionPolicy
writer IndexWriter
numSnapshots int
return void
        protected internal virtual void PrepareIndexAndSnapshots(SnapshotDeletionPolicy sdp, IndexWriter writer, int numSnapshots)
        {
            for (int i = 0; i < numSnapshots; i++)
            {
                // create dummy document to trigger commit.
                writer.AddDocument(new Document());
                writer.Commit();
                Snapshots.Add(sdp.Snapshot());
            }
        }