更新时间:2022-02-12 22:42:06
在创建索引时提供它。
$curl -XPOST localhost:9200/test -d '{
"settings" : {
"number_of_shards" : 1
},
"mappings" : {
"_default_":{
"_timestamp" : {
"enabled" : true,
"store" : true
}
}
}
}'
然后会自动创建一个 _timestamp 为您放在索引中的所有内容。
然后在请求_timestamp字段后索引一些东西,它将被返回。
That will then automatically create a _timestamp for all stuff that you put in the index. Then after indexing something when requesting the _timestamp field it will be returned.