Adding Timestamp to each document added in ElasticSearch

☆樱花仙子☆ 提交于 2019-12-11 22:27:42

问题


How can I create an Index and Mapping with the timestamp field so each added document will include a timestamp by default.

I am using NEST (C#) but I just cant figure out how to do it.

I am also using Kibana but it seems not to work properly because I am missing the timestamp field.

Also, after I am adding this field, is there any way I can 'confirm' the field is added? can I query this field?

Thanks!


回答1:


When you index a document a _timestamp field can be automatically generated for each document.

To enable the timestamp, add the following to your mapping:

{
    "my_mapping" : {
        "_timestamp" : { "enabled" : true, "store" : true }
    }
}


来源:https://stackoverflow.com/questions/27533368/adding-timestamp-to-each-document-added-in-elasticsearch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!