I was following elasticsearch guide for version 6.0: https://www.elastic.co/guide/en/elasticsearch/reference/master/removal-of-types.html
1] To create mapping
PUT /twitter
{
"mappings": {
" **_doc** ": {
"properties": {
"type": { "type": "keyword" },
"name": { "type": "text" },
"user_name": { "type": "keyword" },
"email": { "type": "keyword" },
"content": { "type": "text" },
"tweeted_at": { "type": "date" }
}
}
}
}
2] To create document.
PUT twitter/_doc/user-kimchy
{
"type": "user",
"name": "Shay Banon",
"user_name": "kimchy",
"email": "[email protected]"
}
What is "_doc" in 1 and 2 ? considering the fact that types are going away from Elasticsearch 6.0.0
Thanks in advance !!
Until ES 8.x there will still be an explicit mapping type per index, even though only a single type will be allowed. You are free to choose whatever name you want for that single type, though, but it is advised to use the dummy _doc
(preferred) or doc
type.
Starting with ES 8, types will disappear completely. You can read more about the full schedule planned between ES 5 and 9 to make the removal completely effective.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments