using Lucene.Net.Documents; Document doc = new Document(); doc.Add(new StringField("id", "1234", Field.Store.YES)); doc.Add(new TextField("title", "Lucene Introduction", Field.Store.YES));
using Lucene.Net.Documents; Document doc = new Document(); doc.Add(new StringField("name", "John Doe", Field.Store.YES)); doc.Add(new Int32Field("age", 30, Field.Store.YES)); doc.Add(new DoubleField("salary", 50000.00, Field.Store.YES));In this example, we added three fields to the document: a name field (StringField), an age field (Int32Field), and a salary field (DoubleField). All three fields are stored in the index. The Lucene package library that needs to be included in the project is Lucene.Net.