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",
],

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-28
猜你喜欢
  • 2022-12-23
  • 2021-07-03
  • 2021-11-18
  • 2021-11-26
  • 2021-09-09
相关资源
相似解决方案