org.elasticsearch.index.mapper.xcontent
Class XContentDateFieldMapper
java.lang.Object
org.elasticsearch.index.mapper.xcontent.XContentFieldMapper<T>
org.elasticsearch.index.mapper.xcontent.XContentNumberFieldMapper<java.lang.Long>
org.elasticsearch.index.mapper.xcontent.XContentDateFieldMapper
- All Implemented Interfaces:
- FieldMapper<java.lang.Long>, XContentIncludeInAllMapper, XContentMapper, ToXContent
public class XContentDateFieldMapper
- extends XContentNumberFieldMapper<java.lang.Long>
Constructor Summary |
protected |
XContentDateFieldMapper(FieldMapper.Names names,
FormatDateTimeFormatter dateTimeFormatter,
int precisionStep,
org.apache.lucene.document.Field.Index index,
org.apache.lucene.document.Field.Store store,
float boost,
boolean omitNorms,
boolean omitTermFreqAndPositions,
java.lang.String nullValue)
|
Methods inherited from class org.elasticsearch.index.mapper.xcontent.XContentFieldMapper |
analyzed, boost, index, indexAnalyzer, indexed, merge, name, names, omitNorms, omitTermFreqAndPositions, parse, queryStringTermQuery, searchAnalyzer, store, stored, termVector, toXContent, traverse |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CONTENT_TYPE
public static final java.lang.String CONTENT_TYPE
- See Also:
- Constant Field Values
XContentDateFieldMapper
protected XContentDateFieldMapper(FieldMapper.Names names,
FormatDateTimeFormatter dateTimeFormatter,
int precisionStep,
org.apache.lucene.document.Field.Index index,
org.apache.lucene.document.Field.Store store,
float boost,
boolean omitNorms,
boolean omitTermFreqAndPositions,
java.lang.String nullValue)
maxPrecisionStep
protected int maxPrecisionStep()
- Specified by:
maxPrecisionStep
in class XContentNumberFieldMapper<java.lang.Long>
value
public java.lang.Long value(org.apache.lucene.document.Fieldable field)
- Description copied from interface:
FieldMapper
- Returns the actual value of the field.
valueForSearch
public java.lang.Object valueForSearch(org.apache.lucene.document.Fieldable field)
- Dates should return as a string, delegates to
valueAsString(org.apache.lucene.document.Fieldable)
.
- Specified by:
valueForSearch
in interface FieldMapper<java.lang.Long>
- Overrides:
valueForSearch
in class XContentNumberFieldMapper<java.lang.Long>
valueForSearch
public java.lang.Object valueForSearch(java.lang.Object value)
- Description copied from interface:
FieldMapper
- Returns the value that will be returned to the user (similar to
FieldMapper.valueForSearch(org.apache.lucene.document.Fieldable)
).
- Specified by:
valueForSearch
in interface FieldMapper<java.lang.Long>
- Overrides:
valueForSearch
in class XContentFieldMapper<java.lang.Long>
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 XContentNumberFieldMapper<java.lang.Long>
indexedValue
public java.lang.String indexedValue(java.lang.String value)
- Description copied from interface:
FieldMapper
- Returns the indexed value.
- Specified by:
indexedValue
in interface FieldMapper<java.lang.Long>
- Overrides:
indexedValue
in class XContentFieldMapper<java.lang.Long>
indexedValue
public java.lang.String indexedValue(java.lang.Long value)
- Description copied from interface:
FieldMapper
- Returns the indexed value.
- Specified by:
indexedValue
in interface FieldMapper<java.lang.Long>
- Overrides:
indexedValue
in class XContentFieldMapper<java.lang.Long>
valueFromTerm
public java.lang.Object valueFromTerm(java.lang.String term)
- Description copied from class:
XContentFieldMapper
- Simply returns the same string.
- Specified by:
valueFromTerm
in interface FieldMapper<java.lang.Long>
- Specified by:
valueFromTerm
in class XContentNumberFieldMapper<java.lang.Long>
valueFromString
public java.lang.Object valueFromString(java.lang.String text)
- Description copied from interface:
FieldMapper
- Parses a string that represents the field into its value. For example, with numbers,
it parses "1" to 1.
- Specified by:
valueFromString
in interface FieldMapper<java.lang.Long>
- Specified by:
valueFromString
in class XContentNumberFieldMapper<java.lang.Long>
rangeQuery
public org.apache.lucene.search.Query rangeQuery(java.lang.String lowerTerm,
java.lang.String upperTerm,
boolean includeLower,
boolean includeUpper)
- Description copied from interface:
FieldMapper
- Constructs a range query based on the mapper.
- Specified by:
rangeQuery
in interface FieldMapper<java.lang.Long>
- Specified by:
rangeQuery
in class XContentNumberFieldMapper<java.lang.Long>
rangeFilter
public org.apache.lucene.search.Filter rangeFilter(java.lang.String lowerTerm,
java.lang.String upperTerm,
boolean includeLower,
boolean includeUpper)
- Description copied from interface:
FieldMapper
- Constructs a range query filter based on the mapper.
- Specified by:
rangeFilter
in interface FieldMapper<java.lang.Long>
- Specified by:
rangeFilter
in class XContentNumberFieldMapper<java.lang.Long>
parseCreateField
protected org.apache.lucene.document.Field parseCreateField(ParseContext context)
throws java.io.IOException
- Specified by:
parseCreateField
in class XContentFieldMapper<java.lang.Long>
- Throws:
java.io.IOException
sortType
public int sortType()
- Specified by:
sortType
in interface FieldMapper<java.lang.Long>
- Specified by:
sortType
in class XContentNumberFieldMapper<java.lang.Long>
contentType
protected java.lang.String contentType()
- Specified by:
contentType
in class XContentFieldMapper<java.lang.Long>
doXContentBody
protected void doXContentBody(XContentBuilder builder)
throws java.io.IOException
- Overrides:
doXContentBody
in class XContentNumberFieldMapper<java.lang.Long>
- Throws:
java.io.IOException