remove using field cache when indexing string fields for now

This commit is contained in:
kimchy 2011-04-19 16:16:31 +03:00
parent f8ff42d397
commit 56c9783cb3
1 changed files with 1 additions and 28 deletions

View File

@ -93,12 +93,6 @@ public class StringFieldMapper extends AbstractFieldMapper<String> implements In
public Field field; public Field field;
} }
private ThreadLocal<FieldWrapper> fieldCache = new ThreadLocal<FieldWrapper>() {
@Override protected FieldWrapper initialValue() {
return new FieldWrapper();
}
};
private String nullValue; private String nullValue;
private Boolean includeInAll; private Boolean includeInAll;
@ -156,28 +150,7 @@ public class StringFieldMapper extends AbstractFieldMapper<String> implements In
context.ignoredValue(names.indexName(), value); context.ignoredValue(names.indexName(), value);
return null; return null;
} }
FieldWrapper fieldWrapper = fieldCache.get(); return new Field(names.indexName(), false, value, store, index, termVector);
Field field = fieldWrapper.field;
if (field == null) {
field = new Field(names.indexName(), false, value, store, index, termVector);
} else {
field.setValue(value);
fieldWrapper.field = null;
}
return field;
}
@Override public void processFieldAfterIndex(Fieldable field) {
FieldWrapper fieldWrapper = fieldCache.get();
if (fieldWrapper.field == null) {
Field field1 = (Field) field;
field1.setValue("");
fieldWrapper.field = field1;
}
}
@Override public void close() {
fieldCache.remove();
} }
@Override protected String contentType() { @Override protected String contentType() {