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 |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONTENT_TYPE |
static java.lang.String |
NAME |
| 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,
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() |
void |
parse(ParseContext context) |
protected void |
parseCreateField(ParseContext context,
java.util.List<IndexableField> fields) |
FieldMapper |
updateFieldType(java.util.Map<java.lang.String,MappedFieldType> fullNameToFieldType) |
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()
protected ParentJoinFieldMapper clone()
public ParentJoinFieldMapper.JoinFieldType fieldType()
public java.util.Iterator<Mapper> iterator()
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)
public FieldMapper updateFieldType(java.util.Map<java.lang.String,MappedFieldType> fullNameToFieldType)
protected void parseCreateField(ParseContext context,
java.util.List<IndexableField> fields)
throws java.io.IOException
java.io.IOExceptionpublic void parse(ParseContext context)
throws java.io.IOException
java.io.IOExceptionprotected void doXContentBody(XContentBuilder builder,
boolean includeDefaults,
Params params)
throws java.io.IOException
java.io.IOException