org.elasticsearch.index.mapper.core
Class StringFieldMapper

java.lang.Object
  extended by org.elasticsearch.index.mapper.core.AbstractFieldMapper<String>
      extended by org.elasticsearch.index.mapper.core.StringFieldMapper
All Implemented Interfaces:
ToXContent, FieldMapper<String>, AllFieldMapper.IncludeInAll, Mapper
Direct Known Subclasses:
GeoPointFieldMapper.GeoStringFieldMapper

public class StringFieldMapper
extends AbstractFieldMapper<String>
implements AllFieldMapper.IncludeInAll


Nested Class Summary
static class StringFieldMapper.Builder
           
static class StringFieldMapper.Defaults
           
static class StringFieldMapper.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 String CONTENT_TYPE
           
 
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
protected StringFieldMapper(FieldMapper.Names names, 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, org.apache.lucene.index.FieldInfo.IndexOptions indexOptions, String nullValue, NamedAnalyzer indexAnalyzer, NamedAnalyzer searchAnalyzer)
           
protected StringFieldMapper(FieldMapper.Names names, 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, org.apache.lucene.index.FieldInfo.IndexOptions indexOptions, String nullValue, NamedAnalyzer indexAnalyzer, NamedAnalyzer searchAnalyzer, NamedAnalyzer searchQuotedAnalyzer, int positionOffsetGap, int ignoreAbove)
           
 
Method Summary
protected  String contentType()
           
protected  boolean customBoost()
          Derived classes can override it to specify that boost value is set by derived classes.
protected  void doXContentBody(XContentBuilder builder)
           
 int getPositionOffsetGap()
           
 void includeInAll(Boolean includeInAll)
           
 void includeInAllIfNotSet(Boolean includeInAll)
           
 String indexedValue(String value)
          Returns the indexed value.
 void merge(Mapper mergeWith, MergeContext mergeContext)
           
 org.apache.lucene.search.Filter nullValueFilter()
          Null value filter, returns null if there is no null value associated with the field.
protected  org.apache.lucene.document.Field parseCreateField(ParseContext context)
           
 org.apache.lucene.analysis.Analyzer searchQuoteAnalyzer()
          The analyzer that will be used for quoted search on the field.
 String value(org.apache.lucene.document.Fieldable field)
          Returns the actual value of the field.
 String valueAsString(org.apache.lucene.document.Fieldable field)
          Returns the actual value of the field as string.
 String valueFromString(String value)
           
 
Methods inherited from class org.elasticsearch.index.mapper.core.AbstractFieldMapper
analyzed, boost, close, fieldDataType, fieldFilter, fieldQuery, fuzzyQuery, fuzzyQuery, index, indexAnalyzer, indexed, indexOptions, indexOptionToString, name, names, omitNorms, parse, prefixFilter, prefixQuery, queryStringTermQuery, rangeFilter, rangeQuery, searchAnalyzer, store, stored, termVector, toXContent, traverse, traverse, useFieldQueryWithQueryString, valueForSearch
 
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
 
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContent
toXContent
 

Field Detail

CONTENT_TYPE

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

StringFieldMapper

protected StringFieldMapper(FieldMapper.Names names,
                            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,
                            org.apache.lucene.index.FieldInfo.IndexOptions indexOptions,
                            String nullValue,
                            NamedAnalyzer indexAnalyzer,
                            NamedAnalyzer searchAnalyzer)

StringFieldMapper

protected StringFieldMapper(FieldMapper.Names names,
                            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,
                            org.apache.lucene.index.FieldInfo.IndexOptions indexOptions,
                            String nullValue,
                            NamedAnalyzer indexAnalyzer,
                            NamedAnalyzer searchAnalyzer,
                            NamedAnalyzer searchQuotedAnalyzer,
                            int positionOffsetGap,
                            int ignoreAbove)
Method Detail

includeInAll

public void includeInAll(Boolean includeInAll)
Specified by:
includeInAll in interface AllFieldMapper.IncludeInAll

includeInAllIfNotSet

public void includeInAllIfNotSet(Boolean includeInAll)
Specified by:
includeInAllIfNotSet in interface AllFieldMapper.IncludeInAll

value

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

valueFromString

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

valueAsString

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

indexedValue

public String indexedValue(String value)
Description copied from interface: FieldMapper
Returns the indexed value.

Specified by:
indexedValue in interface FieldMapper<String>
Overrides:
indexedValue in class AbstractFieldMapper<String>

customBoost

protected boolean customBoost()
Description copied from class: AbstractFieldMapper
Derived classes can override it to specify that boost value is set by derived classes.

Overrides:
customBoost in class AbstractFieldMapper<String>

getPositionOffsetGap

public int getPositionOffsetGap()

searchQuoteAnalyzer

public org.apache.lucene.analysis.Analyzer searchQuoteAnalyzer()
Description copied from interface: FieldMapper
The analyzer that will be used for quoted search on the field.

Specified by:
searchQuoteAnalyzer in interface FieldMapper<String>
Overrides:
searchQuoteAnalyzer in class AbstractFieldMapper<String>

nullValueFilter

public org.apache.lucene.search.Filter nullValueFilter()
Description copied from interface: FieldMapper
Null value filter, returns null if there is no null value associated with the field.

Specified by:
nullValueFilter in interface FieldMapper<String>
Overrides:
nullValueFilter in class AbstractFieldMapper<String>

parseCreateField

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

contentType

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

merge

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

doXContentBody

protected void doXContentBody(XContentBuilder builder)
                       throws IOException
Overrides:
doXContentBody in class AbstractFieldMapper<String>
Throws:
IOException


Copyright © 2009-2012. All Rights Reserved.