make last commit compile...

This commit is contained in:
Shay Banon 2011-09-22 00:30:05 +03:00
parent 6d975cd6b7
commit 7adf2fd497
2 changed files with 6 additions and 9 deletions

View File

@ -121,11 +121,11 @@ public class DateFieldMapper extends NumberFieldMapper<Long> {
}
}
private final FormatDateTimeFormatter dateTimeFormatter;
protected final FormatDateTimeFormatter dateTimeFormatter;
private String nullValue;
private TimeUnit timeUnit;
protected final TimeUnit timeUnit;
protected DateFieldMapper(Names names, FormatDateTimeFormatter dateTimeFormatter, int precisionStep, String fuzzyFactor,
Field.Index index, Field.Store store,
@ -313,7 +313,6 @@ public class DateFieldMapper extends NumberFieldMapper<Long> {
}
if (!mergeContext.mergeFlags().simulate()) {
this.nullValue = ((DateFieldMapper) mergeWith).nullValue;
this.timeUnit = ((DateFieldMapper) mergeWith).timeUnit;
}
}
@ -348,11 +347,11 @@ public class DateFieldMapper extends NumberFieldMapper<Long> {
builder.field("include_in_all", includeInAll);
}
if (timeUnit != Defaults.TIME_UNIT) {
builder.field("numeric_resolution", timeUnit);
builder.field("numeric_resolution", timeUnit.name().toLowerCase());
}
}
private long parseStringValue(String value) {
protected long parseStringValue(String value) {
try {
return dateTimeFormatter.parser().parseMillis(value);
} catch (RuntimeException e) {

View File

@ -38,6 +38,7 @@ import org.elasticsearch.index.mapper.core.NumberFieldMapper;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import static org.elasticsearch.common.xcontent.support.XContentMapValues.*;
import static org.elasticsearch.index.mapper.MapperBuilders.*;
@ -117,8 +118,6 @@ public class TimestampFieldMapper extends DateFieldMapper implements InternalMap
private final String path;
private final FormatDateTimeFormatter dateTimeFormatter;
public TimestampFieldMapper() {
this(Defaults.STORE, Defaults.INDEX, Defaults.ENABLED, Defaults.PATH, Defaults.DATE_TIME_FORMATTER);
}
@ -126,10 +125,9 @@ public class TimestampFieldMapper extends DateFieldMapper implements InternalMap
protected TimestampFieldMapper(Field.Store store, Field.Index index, boolean enabled, String path, FormatDateTimeFormatter dateTimeFormatter) {
super(new Names(Defaults.NAME, Defaults.NAME, Defaults.NAME, Defaults.NAME), dateTimeFormatter,
Defaults.PRECISION_STEP, Defaults.FUZZY_FACTOR, index, store, Defaults.BOOST, Defaults.OMIT_NORMS,
Defaults.OMIT_TERM_FREQ_AND_POSITIONS, Defaults.NULL_VALUE);
Defaults.OMIT_TERM_FREQ_AND_POSITIONS, Defaults.NULL_VALUE, TimeUnit.MILLISECONDS /*always milliseconds*/);
this.enabled = enabled;
this.path = path;
this.dateTimeFormatter = dateTimeFormatter;
}
public boolean enabled() {