I am trying to create custom mapping type in elasticsearch 7.3.2 using nodejs client!.But it's only creating default _doc type mapping.When I provide custom doc type it throws me an error that you should give include_type_name = true but in elasticsearch 7.3.2 mapping type has been deprecated!
I have already tried giving custom mapping type with include_type_name=true.
var indexName = req.body.indexName;
var mappingType = req.body.mappingType;
const mapping = {
properties: {
name: {
type: "text",
analyzer: "autocomplete",
search_analyzer: "standard"
},
createdate: {
type: "date"
}
}
}
await esClient.indices.putMapping({
index: indexName,
type: mappingType,
include_type_name:true,
body: mapping
}, (err: any, resp: any, status: any) => {
if (err) {
return res.status(400).json({ status, err });
}
res.status(200).json({ resp, status });
})
}
Expected:I am trying to create custom mapping type because when I ingest the data from Mongodb by using Transporter it takes the mapping type as the name of the collection and the mapping that I am creating which has a default _doc type mapping. Error:"Rejecting mapping update to [tag] as the final mapping would have more than 1 type: [_doc, tags]" tags(collection name