Package org.elasticsearch.index.mapper
Class DocumentMapper
- java.lang.Object
-
- org.elasticsearch.index.mapper.DocumentMapper
-
- All Implemented Interfaces:
ToXContent,ToXContentFragment
public class DocumentMapper extends Object implements ToXContentFragment
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDocumentMapper.Builder-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
-
Field Summary
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description DocumentMapper(MapperService mapperService, Mapping mapping)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Constructor Detail
-
DocumentMapper
public DocumentMapper(MapperService mapperService, Mapping mapping)
-
-
Method Detail
-
mapping
public Mapping mapping()
-
type
public String type()
-
typeText
public Text typeText()
-
mappingSource
public CompressedXContent mappingSource()
-
root
public RootObjectMapper root()
-
metadataMapper
public <T extends MetadataFieldMapper> T metadataMapper(Class<T> type)
-
indexMapper
public IndexFieldMapper indexMapper()
-
typeMapper
public TypeFieldMapper typeMapper()
-
sourceMapper
public SourceFieldMapper sourceMapper()
-
idFieldMapper
public IdFieldMapper idFieldMapper()
-
routingFieldMapper
public RoutingFieldMapper routingFieldMapper()
-
IndexFieldMapper
public IndexFieldMapper IndexFieldMapper()
-
typeFilter
public Query typeFilter(QueryShardContext context)
-
hasNestedObjects
public boolean hasNestedObjects()
-
mappers
public DocumentFieldMappers mappers()
-
objectMappers
public Map<String,ObjectMapper> objectMappers()
-
parse
public ParsedDocument parse(SourceToParse source) throws MapperParsingException
- Throws:
MapperParsingException
-
createDeleteTombstoneDoc
public ParsedDocument createDeleteTombstoneDoc(String index, String type, String id) throws MapperParsingException
- Throws:
MapperParsingException
-
createNoopTombstoneDoc
public ParsedDocument createNoopTombstoneDoc(String index, String reason) throws MapperParsingException
- Throws:
MapperParsingException
-
findNestedObjectMapper
public ObjectMapper findNestedObjectMapper(int nestedDocId, SearchContext sc, LeafReaderContext context) throws IOException
Returns the best nestedObjectMapperinstances that is in the scope of the specified nested docId.- Throws:
IOException
-
merge
public DocumentMapper merge(Mapping mapping)
-
updateFieldType
public DocumentMapper updateFieldType(Map<String,MappedFieldType> fullNameToFieldType)
Recursively update sub field types.
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
-