public final class ParentJoinFieldMapper extends FieldMapper
FieldMapper
that creates hierarchical joins (parent-join) between documents in the same index.
Only one parent-join field can be defined per index. The verification of this assumption is done
through the MetaJoinFieldMapper
which declares a meta field called "_parent_join".
This field is only used to ensure that there is a single parent-join field defined in the mapping and
cannot be used to index or query any data.Modifier and Type | Class and Description |
---|---|
static class |
ParentJoinFieldMapper.Builder |
static class |
ParentJoinFieldMapper.Defaults |
static class |
ParentJoinFieldMapper.JoinFieldType |
static class |
ParentJoinFieldMapper.TypeParser |
FieldMapper.CopyTo, FieldMapper.MultiFields
Mapper.BuilderContext
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONTENT_TYPE |
static java.lang.String |
NAME |
COERCE_SETTING, copyTo, defaultFieldType, fieldType, IGNORE_MALFORMED_SETTING, indexCreatedVersion, multiFields
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
ParentJoinFieldMapper(java.lang.String simpleName,
MappedFieldType fieldType,
Settings indexSettings,
MetaJoinFieldMapper uniqueFieldMapper,
java.util.List<ParentIdFieldMapper> parentIdFields,
boolean eagerGlobalOrdinals) |
Modifier and Type | Method and Description |
---|---|
protected ParentJoinFieldMapper |
clone() |
protected java.lang.String |
contentType() |
protected void |
doMerge(Mapper mergeWith,
boolean updateAllTypes) |
protected void |
doXContentBody(XContentBuilder builder,
boolean includeDefaults,
ToXContent.Params params) |
ParentJoinFieldMapper.JoinFieldType |
fieldType() |
static ParentJoinFieldMapper |
getMapper(MapperService service)
Returns the
ParentJoinFieldMapper associated with the service or null
if there is no parent-join field in this mapping. |
ParentIdFieldMapper |
getParentIdFieldMapper(java.lang.String name,
boolean isParent)
Returns the parent Id field mapper associated with a parent
name
if isParent is true and a child name otherwise. |
boolean |
hasChild(java.lang.String name)
Returns true if
name is a child name in the field. |
boolean |
hasParent(java.lang.String name)
Returns true if
name is a parent name in the field. |
java.util.Iterator<Mapper> |
iterator() |
Mapper |
parse(ParseContext context) |
protected void |
parseCreateField(ParseContext context,
java.util.List<IndexableField> fields) |
FieldMapper |
updateFieldType(java.util.Map<java.lang.String,MappedFieldType> fullNameToFieldType) |
copyTo, customBoost, doXContentAnalyzers, doXContentDocValues, indexOptionToString, indexTokenizeOption, merge, name, termVectorOptionsToString, toXContent
simpleName
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isFragment
public static final java.lang.String NAME
public static final java.lang.String CONTENT_TYPE
protected ParentJoinFieldMapper(java.lang.String simpleName, MappedFieldType fieldType, Settings indexSettings, MetaJoinFieldMapper uniqueFieldMapper, java.util.List<ParentIdFieldMapper> parentIdFields, boolean eagerGlobalOrdinals)
public static ParentJoinFieldMapper getMapper(MapperService service)
ParentJoinFieldMapper
associated with the service
or null
if there is no parent-join field in this mapping.protected java.lang.String contentType()
contentType
in class FieldMapper
protected ParentJoinFieldMapper clone()
clone
in class FieldMapper
public ParentJoinFieldMapper.JoinFieldType fieldType()
fieldType
in class FieldMapper
public java.util.Iterator<Mapper> iterator()
iterator
in interface java.lang.Iterable<Mapper>
iterator
in class FieldMapper
public boolean hasParent(java.lang.String name)
name
is a parent name in the field.public boolean hasChild(java.lang.String name)
name
is a child name in the field.public ParentIdFieldMapper getParentIdFieldMapper(java.lang.String name, boolean isParent)
name
if isParent
is true and a child name
otherwise.protected void doMerge(Mapper mergeWith, boolean updateAllTypes)
doMerge
in class FieldMapper
public FieldMapper updateFieldType(java.util.Map<java.lang.String,MappedFieldType> fullNameToFieldType)
updateFieldType
in class FieldMapper
protected void parseCreateField(ParseContext context, java.util.List<IndexableField> fields) throws java.io.IOException
parseCreateField
in class FieldMapper
java.io.IOException
public Mapper parse(ParseContext context) throws java.io.IOException
parse
in class FieldMapper
java.io.IOException
protected void doXContentBody(XContentBuilder builder, boolean includeDefaults, ToXContent.Params params) throws java.io.IOException
doXContentBody
in class FieldMapper
java.io.IOException