2017-04-11 48 views

回答

2

是的,您可以在Date類型字段中存儲unix時間戳。但請確保您使用適當的format,如epoch_millis以毫秒爲單位的時間戳,epoch_second以秒爲單位的時間戳。

timestamp字段的示例映射,其中存儲以秒爲單位的unix時間戳。

PUT my-index 
{ 
    "mappings": { 
    "my-type": { 
     "properties": { 
     "timestamp": { 
      "type": "date", 
      "format": "epoch_second" 
     } 
     } 
    } 
    } 
} 

你可以找到更多信息here

相關問題