我有一个计算桶如下

<computed-bucket name="older"  lt="-P1Y" anchor="start-of-year">Older</computed-bucket>
<computed-bucket lt="P1Y" ge="P0Y" anchor="start-of-year" name="thisyear">This Year</computed-bucket>
<computed-bucket lt="P1M" ge="P0M" anchor="start-of-month" name="thismonth">This Month</computed-bucket>
<computed-bucket lt="-P1D" ge="-P15D" anchor="start-of-day" name="twoweeks">Last 2 Weeks</computed-bucket>
<computed-bucket lt="P0D" ge="-P1D" anchor="start-of-day" name="yesterday">Yesterday</computed-bucket>
<computed-bucket lt="P1D" ge="P0D" anchor="start-of-day" name="today">Today</computed-bucket>

我的数据库中有文档,时区也以 ISO 格式指定。ML 中的存储桶会根据 UTC 计算吗?如果可以,我可以强制计算不同时区的桶吗?

最佳答案

存储桶将基于主机的时区。如果您无法将主机配置为所需的时区,您可以计算偏移量并将它们应用于您的 anchor ;但是,我认为动态 anchor ( start-of-daystart-of-month 、...)与主机的当前时间相关。

关于Marklogic 计算桶和 UTC 时区,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38312654/

10-12 16:45