将时间戳添加到ElasticSearch中添加的每个文档 [英] Adding Timestamp to each document added in ElasticSearch

查看:3952
本文介绍了将时间戳添加到ElasticSearch中添加的每个文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用NEST(C#)但是我使用的是



我也使用Kibana,但似乎没有正常工作,因为我缺少时间戳记字段。



此外,在我添加此字段后,是否有任何方式可以确认添加该字段?我可以查询这个字段吗?



谢谢!

解决方案

为文档索引 _timestamp 字段可以要为每个文档自动生成。



要启用时间戳,请在映射中添加以下内容:

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


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!

解决方案

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 }
    }
}

这篇关于将时间戳添加到ElasticSearch中添加的每个文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆