org.elasticsearch.index.mapper.internal
Class TTLFieldMapper

java.lang.Object
  extended by org.elasticsearch.index.mapper.core.AbstractFieldMapper<T>
      extended by org.elasticsearch.index.mapper.core.NumberFieldMapper<Long>
          extended by org.elasticsearch.index.mapper.core.LongFieldMapper
              extended by org.elasticsearch.index.mapper.internal.TTLFieldMapper
All Implemented Interfaces:
ToXContent, FieldMapper<Long>, AllFieldMapper.IncludeInAll, InternalMapper, Mapper, RootMapper

public class TTLFieldMapper
extends LongFieldMapper
implements InternalMapper, RootMapper


Nested Class Summary
static class TTLFieldMapper.Builder
           
static class TTLFieldMapper.Defaults
           
static class TTLFieldMapper.TypeParser
           
 
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.core.LongFieldMapper
LongFieldMapper.CustomLongNumericField
 
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.core.NumberFieldMapper
NumberFieldMapper.CustomNumericField
 
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.core.AbstractFieldMapper
AbstractFieldMapper.OpenBuilder<T extends AbstractFieldMapper.Builder,Y extends AbstractFieldMapper>
 
Nested classes/interfaces inherited from interface org.elasticsearch.index.mapper.Mapper
Mapper.BuilderContext
 
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.MapParams, ToXContent.Params
 
Nested classes/interfaces inherited from interface org.elasticsearch.index.mapper.FieldMapper
FieldMapper.Names
 
Field Summary
static String CONTENT_TYPE
           
static String NAME
           
 
Fields inherited from class org.elasticsearch.index.mapper.core.NumberFieldMapper
dFuzzyFactor, fuzzyFactor, ignoreMalformed, includeInAll, precisionStep
 
Fields inherited from class org.elasticsearch.index.mapper.core.AbstractFieldMapper
boost, index, indexAnalyzer, indexOptions, names, omitNorms, searchAnalyzer, store, termVector
 
Fields inherited from interface org.elasticsearch.index.mapper.Mapper
EMPTY_ARRAY
 
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
 
Constructor Summary
  TTLFieldMapper()
           
protected TTLFieldMapper(org.apache.lucene.document.Field.Store store, org.apache.lucene.document.Field.Index index, boolean enabled, long defaultTTL, boolean ignoreMalformed)
           
 
Method Summary
 long defaultTTL()
           
 boolean enabled()
           
 boolean includeInObject()
          Should the mapper be included in the root ObjectMapper.
protected  org.apache.lucene.document.Fieldable innerParseCreateField(ParseContext context)
           
 void merge(Mapper mergeWith, MergeContext mergeContext)
           
 void parse(ParseContext context)
           
 void postParse(ParseContext context)
           
 void preParse(ParseContext context)
           
 XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params)
           
 void validate(ParseContext context)
           
 Object valueForSearch(org.apache.lucene.document.Fieldable field)
          Override the default behavior (to return the string, and return the actual Number instance).
 Object valueForSearch(long expirationTime)
           
 
Methods inherited from class org.elasticsearch.index.mapper.core.LongFieldMapper
contentType, customBoost, doXContentBody, fieldDataType, fieldFilter, fieldQuery, fuzzyQuery, fuzzyQuery, indexedValue, maxPrecisionStep, nullValueFilter, rangeFilter, rangeFilter, rangeQuery, value, valueFromString
 
Methods inherited from class org.elasticsearch.index.mapper.core.NumberFieldMapper
close, includeInAll, includeInAllIfNotSet, parseCreateField, parseFuzzyFactor, popCachedStream, precisionStep, useFieldQueryWithQueryString, valueAsString
 
Methods inherited from class org.elasticsearch.index.mapper.core.AbstractFieldMapper
analyzed, boost, index, indexAnalyzer, indexed, indexOptions, indexOptionToString, name, names, omitNorms, prefixFilter, prefixQuery, queryStringTermQuery, searchAnalyzer, searchQuoteAnalyzer, store, stored, termVector, traverse, traverse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.elasticsearch.index.mapper.Mapper
close, name, traverse, traverse
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values

CONTENT_TYPE

public static final String CONTENT_TYPE
See Also:
Constant Field Values
Constructor Detail

TTLFieldMapper

public TTLFieldMapper()

TTLFieldMapper

protected TTLFieldMapper(org.apache.lucene.document.Field.Store store,
                         org.apache.lucene.document.Field.Index index,
                         boolean enabled,
                         long defaultTTL,
                         boolean ignoreMalformed)
Method Detail

enabled

public boolean enabled()

defaultTTL

public long defaultTTL()

valueForSearch

public Object valueForSearch(org.apache.lucene.document.Fieldable field)
Description copied from class: NumberFieldMapper
Override the default behavior (to return the string, and return the actual Number instance).

Specified by:
valueForSearch in interface FieldMapper<Long>
Overrides:
valueForSearch in class NumberFieldMapper<Long>

valueForSearch

public Object valueForSearch(long expirationTime)

validate

public void validate(ParseContext context)
              throws MapperParsingException
Specified by:
validate in interface RootMapper
Throws:
MapperParsingException

preParse

public void preParse(ParseContext context)
              throws IOException
Specified by:
preParse in interface RootMapper
Throws:
IOException

postParse

public void postParse(ParseContext context)
               throws IOException
Specified by:
postParse in interface RootMapper
Throws:
IOException

parse

public void parse(ParseContext context)
           throws IOException,
                  MapperParsingException
Specified by:
parse in interface Mapper
Overrides:
parse in class AbstractFieldMapper<Long>
Throws:
IOException
MapperParsingException

includeInObject

public boolean includeInObject()
Description copied from interface: RootMapper
Should the mapper be included in the root ObjectMapper.

Specified by:
includeInObject in interface RootMapper

innerParseCreateField

protected org.apache.lucene.document.Fieldable innerParseCreateField(ParseContext context)
                                                              throws IOException,
                                                                     AlreadyExpiredException
Overrides:
innerParseCreateField in class LongFieldMapper
Throws:
IOException
AlreadyExpiredException

toXContent

public XContentBuilder toXContent(XContentBuilder builder,
                                  ToXContent.Params params)
                           throws IOException
Specified by:
toXContent in interface ToXContent
Overrides:
toXContent in class AbstractFieldMapper<Long>
Throws:
IOException

merge

public void merge(Mapper mergeWith,
                  MergeContext mergeContext)
           throws MergeMappingException
Specified by:
merge in interface Mapper
Overrides:
merge in class LongFieldMapper
Throws:
MergeMappingException


Copyright © 2009-2012. All Rights Reserved.