private Document Adoc(System.String[] vals) { Document doc = new Document(); for (int i = 0; i < vals.Length - 2; i += 2) { doc.Add(new Field(vals[i], vals[i + 1], Field.Store.YES, Field.Index.ANALYZED)); } return doc; } }