我正在使用ES-6,默认情况下candidateCreationTime
在Kibana中被索引为数字。如何将其映射到日期值?
{
"_index": "candidatesources",
"_type": "candidatesource",
"_id": "5c08b8930bcfe318ca2a00f4",
"_version": 3,
"_score": 1,
"_source": {
"candidateNotes": "Some Notes",
"candidateCreationTime": 1544066189124,
"state": "verified"
}
}
我尝试过
PUT candidatesources/_mapping/csdate
{
"properties": {
"candidateCreationTime": {
"type": "date"
}
}
}
但是它给出了以下错误
Rejecting mapping update to [candidatesources] as the final mapping would have more than 1 type: [candidatesource, csdate]
我如何使其成为
date
而不是number
?
最佳答案
在ES 6.x中,只能有一种映射类型。参见this。同样,如上所述,现有字段的here映射无法更新。因此,在您的情况下,您需要创建具有正确映射的新索引,然后将数据重新索引到新索引,或者可以将multi-field添加到映射为candidateCreationTime
字段的现有字段date
中。
关于elasticsearch - Elasticsearch 6映射创建抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53749763/