org.elasticsearch.index.mapper.internal
Class TimestampFieldMapper
java.lang.Object
org.elasticsearch.index.mapper.core.AbstractFieldMapper<T>
org.elasticsearch.index.mapper.core.NumberFieldMapper<java.lang.Long>
org.elasticsearch.index.mapper.core.DateFieldMapper
org.elasticsearch.index.mapper.internal.TimestampFieldMapper
- All Implemented Interfaces:
- ToXContent, FieldMapper<java.lang.Long>, AllFieldMapper.IncludeInAll, InternalMapper, Mapper, RootMapper
public class TimestampFieldMapper
- extends DateFieldMapper
- implements InternalMapper, RootMapper
Methods inherited from class org.elasticsearch.index.mapper.core.DateFieldMapper |
customBoost, doXContentBody, fieldDataType, fuzzyQuery, fuzzyQuery, indexedValue, maxPrecisionStep, parseFuzzyFactor, parseStringValue, parseUpperInclusiveStringValue, rangeFilter, rangeFilter, rangeQuery, value, valueFromString |
Methods inherited from class org.elasticsearch.index.mapper.core.AbstractFieldMapper |
analyzed, boost, index, indexAnalyzer, indexed, name, names, omitNorms, omitTermFreqAndPositions, queryStringTermQuery, searchAnalyzer, store, stored, termVector, traverse, traverse |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
CONTENT_TYPE
public static final java.lang.String CONTENT_TYPE
- See Also:
- Constant Field Values
DEFAULT_DATE_TIME_FORMAT
public static final java.lang.String DEFAULT_DATE_TIME_FORMAT
- See Also:
- Constant Field Values
TimestampFieldMapper
public TimestampFieldMapper()
TimestampFieldMapper
protected TimestampFieldMapper(org.apache.lucene.document.Field.Store store,
org.apache.lucene.document.Field.Index index,
boolean enabled,
java.lang.String path,
FormatDateTimeFormatter dateTimeFormatter,
boolean parseUpperInclusive)
enabled
public boolean enabled()
path
public java.lang.String path()
dateTimeFormatter
public FormatDateTimeFormatter dateTimeFormatter()
valueForSearch
public java.lang.Object valueForSearch(org.apache.lucene.document.Fieldable field)
- Override the default behavior to return a timestamp
- Specified by:
valueForSearch
in interface FieldMapper<java.lang.Long>
- Overrides:
valueForSearch
in class DateFieldMapper
valueAsString
public java.lang.String valueAsString(org.apache.lucene.document.Fieldable field)
- Description copied from interface:
FieldMapper
- Returns the actual value of the field as string.
- Specified by:
valueAsString
in interface FieldMapper<java.lang.Long>
- Overrides:
valueAsString
in class DateFieldMapper
validate
public void validate(ParseContext context)
throws MapperParsingException
- Specified by:
validate
in interface RootMapper
- Throws:
MapperParsingException
preParse
public void preParse(ParseContext context)
throws java.io.IOException
- Specified by:
preParse
in interface RootMapper
- Throws:
java.io.IOException
postParse
public void postParse(ParseContext context)
throws java.io.IOException
- Specified by:
postParse
in interface RootMapper
- Throws:
java.io.IOException
parse
public void parse(ParseContext context)
throws java.io.IOException
- Specified by:
parse
in interface Mapper
- Overrides:
parse
in class AbstractFieldMapper<java.lang.Long>
- Throws:
java.io.IOException
includeInObject
public boolean includeInObject()
- Description copied from interface:
RootMapper
- Should the mapper be included in the root
ObjectMapper
.
- Specified by:
includeInObject
in interface RootMapper
parseCreateField
protected org.apache.lucene.document.Fieldable parseCreateField(ParseContext context)
throws java.io.IOException
- Overrides:
parseCreateField
in class DateFieldMapper
- Throws:
java.io.IOException
contentType
protected java.lang.String contentType()
- Overrides:
contentType
in class DateFieldMapper
toXContent
public XContentBuilder toXContent(XContentBuilder builder,
ToXContent.Params params)
throws java.io.IOException
- Specified by:
toXContent
in interface ToXContent
- Overrides:
toXContent
in class AbstractFieldMapper<java.lang.Long>
- Throws:
java.io.IOException
merge
public void merge(Mapper mergeWith,
MergeContext mergeContext)
throws MergeMappingException
- Specified by:
merge
in interface Mapper
- Overrides:
merge
in class DateFieldMapper
- Throws:
MergeMappingException