Elasticsearch 2.0:_id不可配置

cur*_*us1 3 elasticsearch elasticsearch-2.0

ES 2.0刚刚发布.出于好奇,我测试了我的ES 1.7.3针对ES 2.0的映射文件.我收到以下错误:

{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "_id is not configurable"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "mapping [mydoctype]",
    "caused_by": {
      "type": "mapper_parsing_exception",
      "reason": "_id is not configurable"
    }
  },
  "status": 400
}
Run Code Online (Sandbox Code Playgroud)

基本上,这个错误抱怨我的映射文件包含以下内容:

"mydoctype": {
    "_id" : {
        "path" : "id"
    },
Run Code Online (Sandbox Code Playgroud)

刚刚谷歌并没有找到一种方法将doc _id设置为ES 2.0中索引文档的实际标识符.我怎样才能做到这一点?

感谢任何指针和输入!

Val*_*Val 6

根据发布的博客文章,您现在需要在索引查询中明确设置值,即

curl -XPUT localhost:9200/your_index/your_type/YOUR_ID -d '{...}'
                                                  ^
                                                  |
                                          set your id here
Run Code Online (Sandbox Code Playgroud)

或者在您的_bulk查询中:

curl -XPOST localhost:9200/your_index/your_type/_bulk -d '
{"index": {"_id": "YOUR_ID"}}
{...}                 ^
'                     |
              set your id here
Run Code Online (Sandbox Code Playgroud)