Lucene.Net.Index.TestTermsEnum.AddDoc C# (CSharp) Method

AddDoc() private method

private AddDoc ( RandomIndexWriter w, ICollection terms, int?>.IDictionary termToID, int id ) : void
w RandomIndexWriter
terms ICollection
termToID int?>.IDictionary
id int
return void
        private void AddDoc(RandomIndexWriter w, ICollection<string> terms, IDictionary<BytesRef, int?> termToID, int id)
        {
            Document doc = new Document();
            doc.Add(new IntField("id", id, Field.Store.NO));
            if (VERBOSE)
            {
                Console.WriteLine("TEST: addDoc id:" + id + " terms=" + terms);
            }
            foreach (string s2 in terms)
            {
                doc.Add(NewStringField("f", s2, Field.Store.NO));
                termToID[new BytesRef(s2)] = id;
            }
            w.AddDocument(doc);
            terms.Clear();
        }