public DocState(boolean reuseFields, FieldType ft, FieldType bodyFt) {this.reuseFields = reuseFields;if (reuseFields) {fields =  new HashMap<>();numericFields = new HashMap<>();fields.put(BODY_FIELD, new Field(BODY_FIELD, "", bodyFt));fields.put(TITLE_FIELD, new Field(TITLE_FIELD, "", ft));fields.put(DATE_FIELD, new Field(DATE_FIELD, "", ft));fields.put(ID_FIELD, new StringField(ID_FIELD, "", Field.Store.YES));fields.put(NAME_FIELD, new Field(NAME_FIELD, "", ft));numericFields.put(DATE_MSEC_FIELD, new LongPoint(DATE_MSEC_FIELD, 0L));numericFields.put(TIME_SEC_FIELD, new IntPoint(TIME_SEC_FIELD, 0));doc = new Document();} else {numericFields = null;fields = null;doc = null;}}
public DocState(bool reuseFields, FieldType ft, FieldType bodyFt){this.reuseFields = reuseFields;if (reuseFields){fields = new Dictionary<string, Field>();numericFields = new Dictionary<string, Field>();fields[BODY_FIELD] = new Field(BODY_FIELD, "", bodyFt);fields[TITLE_FIELD] = new Field(TITLE_FIELD, "", ft);fields[DATE_FIELD] = new Field(DATE_FIELD, "", ft);fields[ID_FIELD] = new StringField(ID_FIELD, "", Field.Store.YES);fields[NAME_FIELD] = new Field(NAME_FIELD, "", ft);numericFields[DATE_MSEC_FIELD] = new Int64Field(DATE_MSEC_FIELD, 0L, Field.Store.NO);numericFields[TIME_SEC_FIELD] = new Int32Field(TIME_SEC_FIELD, 0, Field.Store.NO);doc = new Document();}else{numericFields = null;fields = null;doc = null;}}