es date类型 使用format 设置mapping
在Elasticsearch中,您可以使用以下方式将日期类型设置为mapping:
PUT my_index
{
"mappings": {
"properties": {
"my_date_field": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss"
}
}
}
}
在上面的示例中,我们定义了一个名为“my_date_field”的日期类型字段,并将其设置为格式为“yyyy-MM-dd HH:mm:ss”。您可以使用不同的日期格式,具体取决于您的需求。
原文地址: http://www.cveoy.top/t/topic/htH3 著作权归作者所有。请勿转载和采集!