我不明白为什么当我对它进行过滤时ES会将我的_id字段加倍 .
curl -X GET "http://localhost:9200/pgep-development_broadcasts/broadcast/_search?pretty=true" -d '{"query":{"match_all":{}},"fields":["_id", "title"]}'
{
"took" : 7,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [ {
"_index" : "pgep-development_broadcasts",
"_type" : "broadcast",
"_id" : "50ed959dcc93282abc000062",
"_score" : 1.0,
"fields" : {
"_id" : [ "50ed959dcc93282abc000062", "50ed959dcc93282abc000062" ],
"title" : "24 heures d'info"
}
} ]
}
}
1 回答
你可能会遇到这个错误https://github.com/elasticsearch/elasticsearch/issues/2161 . 如果是这种情况,您只需停止存储id字段即可 .