打赏

es的日期格式

https://www.elastic.co/guide/en/elasticsearch/reference/2.3/mapping-date-format.html

在es中,默认的时间类型为date, date类型的默认格式为:"strict_date_optional_time||epoch_millis",并未含有yyyy-MM-dd HH:mm:ss 格式,因此需要格式化时间

在写入es的时候,在mapping中的时间格式要增加yyyy-MM-dd HH:mm:ss的格式。

//时间
'created_at' => [
    'type' => 'date',
    'format'=>"yyyy-MM-dd HH:mm:ss"

    //"analyzer" => "ik_max_word",
    //"search_analyzer" => "ik_smart",
],

 

posted on 2019-07-31 16:42  头大的冯冯  阅读(4366)  评论(0编辑  收藏  举报

导航