Lucene.Net.Index.TestStressIndexing.IndexerThread.DoWork C# (CSharp) Method

DoWork() public method

public DoWork ( ) : void
return void
            public override void DoWork()
            {
                // Add 10 docs:
                for (int j = 0; j < 10; j++)
                {
                    Documents.Document d = new Documents.Document();
                    int n = Random().Next();
                    d.Add(NewStringFieldFunc("id", Convert.ToString(NextID++), Field.Store.YES));
                    d.Add(NewTextFieldFunc("contents", English.IntToEnglish(n), Field.Store.NO));
                    Writer.AddDocument(d);
                }

                // Delete 5 docs:
                int deleteID = NextID - 1;
                for (int j = 0; j < 5; j++)
                {
                    Writer.DeleteDocuments(new Term("id", "" + deleteID));
                    deleteID -= 2;
                }
            }
        }
TestStressIndexing.IndexerThread