public abstract class FieldMapper extends Mapper implements Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
FieldMapper.Builder<T extends FieldMapper.Builder,Y extends FieldMapper> |
static class |
FieldMapper.CopyTo
Represents a list of fields with optional boost factor where the current field should be copied to
|
static class |
FieldMapper.MultiFields |
Mapper.BuilderContext, Mapper.TypeParser
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
protected FieldMapper.CopyTo |
copyTo |
protected MappedFieldType |
defaultFieldType |
protected MappedFieldType |
fieldType |
protected boolean |
indexCreatedBefore2x |
protected FieldMapper.MultiFields |
multiFields |
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
FieldMapper(String simpleName,
MappedFieldType fieldType,
MappedFieldType defaultFieldType,
Settings indexSettings,
FieldMapper.MultiFields multiFields,
FieldMapper.CopyTo copyTo) |
Modifier and Type | Method and Description |
---|---|
protected FieldMapper |
clone() |
protected abstract String |
contentType() |
FieldMapper.CopyTo |
copyTo()
List of fields where this field should be copied to
|
protected boolean |
customBoost()
Derived classes can override it to specify that boost value is set by derived classes.
|
protected void |
doMerge(Mapper mergeWith,
boolean updateAllTypes)
Merge changes coming from
mergeWith in place. |
protected void |
doXContentAnalyzers(XContentBuilder builder,
boolean includeDefaults) |
protected void |
doXContentBody(XContentBuilder builder,
boolean includeDefaults,
ToXContent.Params params) |
protected void |
doXContentDocValues(XContentBuilder builder,
boolean includeDefaults) |
MappedFieldType |
fieldType() |
protected boolean |
hasCustomFieldDataSettings() |
protected static String |
indexOptionToString(org.apache.lucene.index.IndexOptions indexOption) |
protected static String |
indexTokenizeOptionToString(boolean indexed,
boolean tokenized) |
boolean |
isGenerated()
Fields might not be available before indexing, for example _all, token_count,...
|
Iterator<Mapper> |
iterator() |
FieldMapper |
merge(Mapper mergeWith,
boolean updateAllTypes)
Return the merge of
mergeWith into this. |
String |
name()
Returns the canonical name which uniquely identifies the mapper against other mappers in a type.
|
Mapper |
parse(ParseContext context)
Parse using the provided
ParseContext and return a mapping
update if dynamic mappings modified the mappings, or null if
mappings were not modified. |
protected abstract void |
parseCreateField(ParseContext context,
List<org.apache.lucene.document.Field> fields)
Parse the field value and populate
fields . |
static String |
termVectorOptionsToString(org.apache.lucene.document.FieldType fieldType) |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
FieldMapper |
updateFieldType(Map<String,MappedFieldType> fullNameToFieldType)
Update the field type of this mapper.
|
simpleName
protected MappedFieldType fieldType
protected final MappedFieldType defaultFieldType
protected FieldMapper.MultiFields multiFields
protected FieldMapper.CopyTo copyTo
protected final boolean indexCreatedBefore2x
protected FieldMapper(String simpleName, MappedFieldType fieldType, MappedFieldType defaultFieldType, Settings indexSettings, FieldMapper.MultiFields multiFields, FieldMapper.CopyTo copyTo)
public String name()
Mapper
public MappedFieldType fieldType()
public FieldMapper.CopyTo copyTo()
public Mapper parse(ParseContext context) throws IOException
ParseContext
and return a mapping
update if dynamic mappings modified the mappings, or null
if
mappings were not modified.IOException
protected abstract void parseCreateField(ParseContext context, List<org.apache.lucene.document.Field> fields) throws IOException
fields
.IOException
protected boolean customBoost()
protected FieldMapper clone()
public FieldMapper merge(Mapper mergeWith, boolean updateAllTypes)
Mapper
mergeWith
into this.
Both this
and mergeWith
will be left unmodified.protected void doMerge(Mapper mergeWith, boolean updateAllTypes)
mergeWith
in place.updateAllTypes
- TODOpublic FieldMapper updateFieldType(Map<String,MappedFieldType> fullNameToFieldType)
Mapper
updateFieldType
in class Mapper
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
toXContent
in interface ToXContent
IOException
protected void doXContentBody(XContentBuilder builder, boolean includeDefaults, ToXContent.Params params) throws IOException
IOException
protected final void doXContentAnalyzers(XContentBuilder builder, boolean includeDefaults) throws IOException
IOException
protected void doXContentDocValues(XContentBuilder builder, boolean includeDefaults) throws IOException
IOException
protected static String indexOptionToString(org.apache.lucene.index.IndexOptions indexOption)
public static String termVectorOptionsToString(org.apache.lucene.document.FieldType fieldType)
protected static String indexTokenizeOptionToString(boolean indexed, boolean tokenized)
protected boolean hasCustomFieldDataSettings()
protected abstract String contentType()
public boolean isGenerated()
Copyright © 2009–2016. All rights reserved.