org.elasticsearch.index.mapper.internal
Class TypeFieldMapper

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

public class TypeFieldMapper
extends AbstractFieldMapper<java.lang.String>
implements InternalMapper


Nested Class Summary
static class TypeFieldMapper.Builder
           
static class TypeFieldMapper.Defaults
           
 
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.FieldMapper
FieldMapper.Names
 
Nested classes/interfaces inherited from interface org.elasticsearch.index.mapper.Mapper
Mapper.BuilderContext, Mapper.TypeParser
 
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.MapParams, ToXContent.Params
 
Field Summary
static java.lang.String CONTENT_TYPE
           
static java.lang.String NAME
           
static org.apache.lucene.index.Term TERM_FACTORY
           
 
Fields inherited from class org.elasticsearch.index.mapper.core.AbstractFieldMapper
boost, index, indexAnalyzer, names, omitNorms, omitTermFreqAndPositions, searchAnalyzer, store, termFactory, 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
  TypeFieldMapper()
           
protected TypeFieldMapper(java.lang.String name, java.lang.String indexName)
           
  TypeFieldMapper(java.lang.String name, java.lang.String indexName, org.apache.lucene.document.Field.Index index, org.apache.lucene.document.Field.Store store, org.apache.lucene.document.Field.TermVector termVector, float boost, boolean omitNorms, boolean omitTermFreqAndPositions)
           
 
Method Summary
protected  java.lang.String contentType()
           
 org.apache.lucene.search.Filter fieldFilter(java.lang.String value)
           
 org.apache.lucene.search.Query fieldQuery(java.lang.String value, QueryParseContext context)
          A field query for the specified value.
 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)
           
 org.apache.lucene.index.Term term(java.lang.String value)
           
 XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params)
           
 boolean useFieldQueryWithQueryString()
          Should the field query FieldMapper.fieldQuery(String, org.elasticsearch.index.query.QueryParseContext) be used when detecting this field in query string.
 java.lang.String value(org.apache.lucene.document.Document document)
           
 java.lang.String 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.String valueFromString(java.lang.String value)
           
 
Methods inherited from class org.elasticsearch.index.mapper.core.AbstractFieldMapper
analyzed, boost, close, customBoost, doXContentBody, fieldDataType, fuzzyQuery, fuzzyQuery, index, indexAnalyzer, indexed, name, names, omitNorms, omitTermFreqAndPositions, parse, queryStringTermQuery, rangeFilter, rangeQuery, searchAnalyzer, store, stored, termVector, traverse, traverse, valueForSearch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

TERM_FACTORY

public static final org.apache.lucene.index.Term TERM_FACTORY

CONTENT_TYPE

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

TypeFieldMapper

public TypeFieldMapper()

TypeFieldMapper

protected TypeFieldMapper(java.lang.String name,
                          java.lang.String indexName)

TypeFieldMapper

public TypeFieldMapper(java.lang.String name,
                       java.lang.String indexName,
                       org.apache.lucene.document.Field.Index index,
                       org.apache.lucene.document.Field.Store store,
                       org.apache.lucene.document.Field.TermVector termVector,
                       float boost,
                       boolean omitNorms,
                       boolean omitTermFreqAndPositions)
Method Detail

value

public java.lang.String value(org.apache.lucene.document.Document document)

value

public java.lang.String 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<java.lang.String>

valueFromString

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

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.String>

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.String>
Overrides:
indexedValue in class AbstractFieldMapper<java.lang.String>

term

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

fieldFilter

public org.apache.lucene.search.Filter fieldFilter(java.lang.String value)
Specified by:
fieldFilter in interface FieldMapper<java.lang.String>
Overrides:
fieldFilter in class AbstractFieldMapper<java.lang.String>

fieldQuery

public org.apache.lucene.search.Query fieldQuery(java.lang.String value,
                                                 QueryParseContext context)
Description copied from interface: FieldMapper
A field query for the specified value.

Specified by:
fieldQuery in interface FieldMapper<java.lang.String>
Overrides:
fieldQuery in class AbstractFieldMapper<java.lang.String>

useFieldQueryWithQueryString

public boolean useFieldQueryWithQueryString()
Description copied from interface: FieldMapper
Should the field query FieldMapper.fieldQuery(String, org.elasticsearch.index.query.QueryParseContext) be used when detecting this field in query string.

Specified by:
useFieldQueryWithQueryString in interface FieldMapper<java.lang.String>
Overrides:
useFieldQueryWithQueryString in class AbstractFieldMapper<java.lang.String>

parseCreateField

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

contentType

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

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.String>
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<java.lang.String>
Throws:
MergeMappingException