Calendar cal = Calendar.getInstance();
DateFormat dfDate = new SimpleDateFormat("yyyy,M,d");
for (int i = 0; i < docCount; i++) {
Builder docBuilder = Document.newBuilder();
// two text field with different locale
docBuilder.addField(Field.newBuilder().setName("textfield").setText("text with num " + i));
Field field = Field.newBuilder().setName("textfield").setText("C'est la vie " + i).setLocale(Locale.FRENCH).build();
docBuilder.addField(field);
docBuilder.addField(Field.newBuilder().setName("numfield").setNumber(i));
String dateVal = "" + cal.get(Calendar.YEAR) + ",";
dateVal += cal.get(Calendar.MONTH) + ",";