use of org.opensearch.index.mapper.SourceToParse in project OpenSearch by opensearch-project.
the class TermVectorsService method parseDocument.
private static ParsedDocument parseDocument(IndexShard indexShard, String index, BytesReference doc, XContentType xContentType, String routing) {
MapperService mapperService = indexShard.mapperService();
DocumentMapperForType docMapper = mapperService.documentMapperWithAutoCreate();
ParsedDocument parsedDocument = docMapper.getDocumentMapper().parse(new SourceToParse(index, "_id_for_tv_api", doc, xContentType, routing));
if (docMapper.getMapping() != null) {
parsedDocument.addDynamicMappingsUpdate(docMapper.getMapping());
}
return parsedDocument;
}
Aggregations