gpt4 book ai didi

mapping - 如何让 elasticsearch 为所有索引中的每个文档添加时间戳字段?

转载 作者:行者123 更新时间:2023-11-29 02:43:11 28 4
gpt4 key购买 nike

Elasticsearch 专家,

我一直无法找到一种简单的方法来告诉 ElasticSearch 为添加到所有索引(和所有文档类型)中的所有文档插入 _timestamp 字段。

我看到了特定类型的示例: http://www.elasticsearch.org/guide/reference/mapping/timestamp-field/

并查看特定类型的所有索引的示例(使用 _all): http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping/

但我找不到任何关于默认添加所有文档的文档,无论索引和类型如何。

最佳答案

Elasticsearch 过去支持自动为被索引的文档添加时间戳,但是 deprecated this feature在 2.0.0 中

从版本 5.5 documentation :

The _timestamp and _ttl fields were deprecated and are now removed. As a replacement for _timestamp, you should populate a regular date field with the current timestamp on application side.

关于mapping - 如何让 elasticsearch 为所有索引中的每个文档添加时间戳字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17136138/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com