org.elasticsearch.index.mapper.internal
Class ParentFieldMapper

java.lang.Object
  extended by org.elasticsearch.index.mapper.core.AbstractFieldMapper<Uid>
      extended by org.elasticsearch.index.mapper.internal.ParentFieldMapper
All Implemented Interfaces:
ToXContent, FieldMapper<Uid>, InternalMapper, Mapper, RootMapper

public class ParentFieldMapper
extends AbstractFieldMapper<Uid>
implements InternalMapper, RootMapper


Nested Class Summary
static class ParentFieldMapper.Builder
           
static class ParentFieldMapper.Defaults
           
static class ParentFieldMapper.TypeParser
           
 
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 java.lang.String CONTENT_TYPE
           
static java.lang.String NAME
           
 
Fields inherited from class org.elasticsearch.index.mapper.core.AbstractFieldMapper
boost, index, indexAnalyzer, indexOptions, names, omitNorms, omitTermFreqAndPositions, 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
protected ParentFieldMapper(java.lang.String name, java.lang.String indexName, java.lang.String type)
           
 
Method Summary
protected  java.lang.String contentType()
           
 boolean includeInObject()
          Should the mapper be included in the root ObjectMapper.
 java.lang.String indexedValue(java.lang.String value)
          Returns the indexed value.
 void merge(Mapper mergeWith, MergeContext mergeContext)
           
protected  org.apache.lucene.document.Field parseCreateField(ParseContext context)
           
 void postParse(ParseContext context)
           
 void preParse(ParseContext context)
           
 org.apache.lucene.index.Term term(java.lang.String uid)
           
 org.apache.lucene.index.Term term(java.lang.String type, java.lang.String id)
           
 XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params)
           
 java.lang.String type()
           
 void validate(ParseContext context)
           
 Uid value(org.apache.lucene.document.Fieldable field)
          Returns the actual value of the field.
 java.lang.String valueAsString(org.apache.lucene.document.Fieldable field)
          Returns the actual value of the field as string.
 java.lang.Object valueForSearch(org.apache.lucene.document.Fieldable field)
          Returns the value that will be used as a result for search.
 Uid valueFromString(java.lang.String value)
           
 
Methods inherited from class org.elasticsearch.index.mapper.core.AbstractFieldMapper
analyzed, boost, close, customBoost, doXContentBody, fieldDataType, fieldFilter, fieldQuery, fuzzyQuery, fuzzyQuery, index, indexAnalyzer, indexed, name, names, omitNorms, omitTermFreqAndPositions, parse, queryStringTermQuery, rangeFilter, rangeQuery, searchAnalyzer, store, stored, termVector, traverse, traverse, useFieldQueryWithQueryString
 
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, parse, traverse, traverse
 

Field Detail

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
Constructor Detail

ParentFieldMapper

protected ParentFieldMapper(java.lang.String name,
                            java.lang.String indexName,
                            java.lang.String type)
Method Detail

type

public java.lang.String type()

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

validate

public void validate(ParseContext context)
              throws MapperParsingException
Specified by:
validate in interface RootMapper
Throws:
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

parseCreateField

protected org.apache.lucene.document.Field parseCreateField(ParseContext context)
                                                     throws java.io.IOException
Specified by:
parseCreateField in class AbstractFieldMapper<Uid>
Throws:
java.io.IOException

value

public Uid value(org.apache.lucene.document.Fieldable field)
Description copied from interface: FieldMapper
Returns the actual value of the field.

Specified by:
value in interface FieldMapper<Uid>

valueFromString

public Uid valueFromString(java.lang.String value)
Specified by:
valueFromString in interface FieldMapper<Uid>

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<Uid>

valueForSearch

public java.lang.Object valueForSearch(org.apache.lucene.document.Fieldable field)
Description copied from interface: FieldMapper
Returns the value that will be used as a result for search. Can be only of specific types... .

Specified by:
valueForSearch in interface FieldMapper<Uid>
Overrides:
valueForSearch in class AbstractFieldMapper<Uid>

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<Uid>
Overrides:
indexedValue in class AbstractFieldMapper<Uid>

term

public org.apache.lucene.index.Term term(java.lang.String type,
                                         java.lang.String id)

term

public org.apache.lucene.index.Term term(java.lang.String uid)

contentType

protected java.lang.String contentType()
Specified by:
contentType in class AbstractFieldMapper<Uid>

toXContent

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

merge

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