private Document Doc(int id) { Document doc = new Document(); doc.Add(new StringField("id", "doc-" + id, Store.NO)); doc.Add(new BinaryDocValuesField("val", ToBytes(id + 1))); return doc; }