Mapping type name _doc not accepted in ElasticSearch 5.6

I am looking at examples of indexes of the same type on ElasticSearch 5.6 in preparation for deleting matching types. In particular, I run the first example on the ElasticSearch page about deleting types , in a new cluster running locally in Docker, using the docker.elastic.co/elasticsearch/elasticsearch:5.6.5image

Running the first example from section I related to:

PUT localhost:9200/users
{
  "settings": {
    "index.mapping.single_type": true
  },
  "mappings": {
    "_doc": {
      "properties": {
        "name": {
          "type": "text"
        },
        "user_name": {
          "type": "keyword"
        },
        "email": {
          "type": "keyword"
        }
      }
    }
  }
}

I get the following error:

{
  "error": {
    "root_cause": [
      {
        "type": "invalid_type_name_exception",
        "reason": "mapping type name [_doc] can't start with '_'"
      }
    ],
    "type": "invalid_type_name_exception",
    "reason": "mapping type name [_doc] can't start with '_'"
  },
  "status": 400
}

I understand that fields with leading underscores in the name are usually considered reserved for internal ES elements; but I assumed that it _docwould be considered as a special case, starting with the version 5.6, as the related guide mentions:

, 6.x, . , . _doc, API- , 7.0

- , , ?

+4
1

, , - master. 6.1 5.6 _doc ; , , , _doc 6.x.

+4

Source: https://habr.com/ru/post/1691779/


All Articles