SOLR 日期分面和 BC/BCE 日期/负日期范围

发布于 2024-09-04 09:19:13 字数 2763 浏览 3 评论 0原文

日期范围包括 BC 日期 这可能吗?

我想使用 SOLR 返回公元前 11000 年 (BC) 到公元前 9000 年 (BC) 之间所有年份的分面。

示例查询可能会将日期范围转换为 ISO 8601:

q=*:*&facet.date=myfield_earliestDate&facet.date.end=-92009-01-01T00:00:00&facet.date.gap=%2B1000YEAR&facet.date.other=all&facet=on&f.myfield_earliestDate.facet.date.start=-112009-01-01T00:00:00

但是返回的结果似乎表明日期在正范围内,即 CE,而不是 BCE...

请参阅示例返回的结果

<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">6</int>
<lst name="params">
<str name="f.vra.work.creation.earliestDate.facet.date.start">-112009-01-01T00:00:00Z</str>
<str name="facet">on</str>
<str name="q">*:*</str>
<str name="facet.date">vra.work.creation.earliestDate</str>
<str name="facet.date.gap">+1000YEAR</str>
<str name="facet.date.other">all</str>
<str name="facet.date.end">-92009-01-01T00:00:00Z</str>
</lst>
</lst>
<result name="response" numFound="9556" start="0">ommitted</result>
<lst name="facet_counts">
<lst name="facet_queries"/>
<lst name="facet_fields"/>
<lst name="facet_dates">
<lst name="vra.work.creation.earliestDate">
<int name="112010-01-01T00:00:00Z">0</int>
<int name="111010-01-01T00:00:00Z">0</int>
<int name="110010-01-01T00:00:00Z">0</int>
<int name="109010-01-01T00:00:00Z">0</int>
<int name="108010-01-01T00:00:00Z">0</int>
<int name="107010-01-01T00:00:00Z">0</int>
<int name="106010-01-01T00:00:00Z">0</int>
<int name="105010-01-01T00:00:00Z">0</int>
<int name="104010-01-01T00:00:00Z">0</int>
<int name="103010-01-01T00:00:00Z">0</int>
<int name="102010-01-01T00:00:00Z">0</int>
<int name="101010-01-01T00:00:00Z">0</int>
<int name="100010-01-01T00:00:00Z">5781</int>
<int name="99010-01-01T00:00:00Z">0</int>
<int name="98010-01-01T00:00:00Z">0</int>
<int name="97010-01-01T00:00:00Z">0</int>
<int name="96010-01-01T00:00:00Z">0</int>
<int name="95010-01-01T00:00:00Z">0</int>
<int name="94010-01-01T00:00:00Z">0</int>
<int name="93010-01-01T00:00:00Z">0</int>
<str name="gap">+1000YEAR</str>
<date name="end">92010-01-01T00:00:00Z</date>
<int name="before">224</int>
<int name="after">0</int>
<int name="between">5690</int>
</lst>
</lst>
</lst>
</response>

任何想法为什么会出现这种情况,可以 solr处理负日期,例如 -112009-01-01T00:00:00Z?

Date ranges including BC dates is this possible?

I would like to return facets for all years between 11000 BCE (BC) and 9000 BCE (BC) using SOLR.

A sample query might be with date ranges converted to ISO 8601:

q=*:*&facet.date=myfield_earliestDate&facet.date.end=-92009-01-01T00:00:00&facet.date.gap=%2B1000YEAR&facet.date.other=all&facet=on&f.myfield_earliestDate.facet.date.start=-112009-01-01T00:00:00

However the returned results seem to be suggest that dates are in positive range, ie CE, not BCE...

see sample returned results

<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">6</int>
<lst name="params">
<str name="f.vra.work.creation.earliestDate.facet.date.start">-112009-01-01T00:00:00Z</str>
<str name="facet">on</str>
<str name="q">*:*</str>
<str name="facet.date">vra.work.creation.earliestDate</str>
<str name="facet.date.gap">+1000YEAR</str>
<str name="facet.date.other">all</str>
<str name="facet.date.end">-92009-01-01T00:00:00Z</str>
</lst>
</lst>
<result name="response" numFound="9556" start="0">ommitted</result>
<lst name="facet_counts">
<lst name="facet_queries"/>
<lst name="facet_fields"/>
<lst name="facet_dates">
<lst name="vra.work.creation.earliestDate">
<int name="112010-01-01T00:00:00Z">0</int>
<int name="111010-01-01T00:00:00Z">0</int>
<int name="110010-01-01T00:00:00Z">0</int>
<int name="109010-01-01T00:00:00Z">0</int>
<int name="108010-01-01T00:00:00Z">0</int>
<int name="107010-01-01T00:00:00Z">0</int>
<int name="106010-01-01T00:00:00Z">0</int>
<int name="105010-01-01T00:00:00Z">0</int>
<int name="104010-01-01T00:00:00Z">0</int>
<int name="103010-01-01T00:00:00Z">0</int>
<int name="102010-01-01T00:00:00Z">0</int>
<int name="101010-01-01T00:00:00Z">0</int>
<int name="100010-01-01T00:00:00Z">5781</int>
<int name="99010-01-01T00:00:00Z">0</int>
<int name="98010-01-01T00:00:00Z">0</int>
<int name="97010-01-01T00:00:00Z">0</int>
<int name="96010-01-01T00:00:00Z">0</int>
<int name="95010-01-01T00:00:00Z">0</int>
<int name="94010-01-01T00:00:00Z">0</int>
<int name="93010-01-01T00:00:00Z">0</int>
<str name="gap">+1000YEAR</str>
<date name="end">92010-01-01T00:00:00Z</date>
<int name="before">224</int>
<int name="after">0</int>
<int name="between">5690</int>
</lst>
</lst>
</lst>
</response>

Any ideas why this is the case, can solr handle negative dates such as -112009-01-01T00:00:00Z?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

嘴硬脾气大 2024-09-11 09:19:13

我不认为这是完全支持的。至少我在 源代码测试

我什至尝试使用 日期数学,例如:

facet.date.start: NOW-11000YEARS
facet.date.end: NOW
facet.date.gap: +1000YEAR

并得到了一些奇怪的结果:

<int name="8991-06-07T20:30:45-.666Z">0</int>
<int name="7991-06-07T20:30:45-.666Z">0</int>
<int name="6991-06-07T20:30:45-.666Z">0</int>
<int name="5991-06-07T20:30:45-.666Z">0</int>
<int name="4991-06-07T20:30:45-.666Z">0</int>
<int name="3991-06-07T20:30:45-.666Z">0</int>
<int name="2991-06-07T20:30:45-.666Z">0</int>
<int name="1991-06-07T20:30:45-.666Z">0</int>
<int name="0991-06-07T20:30:45-.666Z">0</int>
<int name="0010-06-07T20:30:45-.666Z">0</int>
<int name="1010-06-07T20:30:45-.666Z">1435</int>

注意秒后的 - 。对我来说看起来像一个错误......

I don't think this is fully supported. At least I don't see any explicit references to BC dates in the source code or the tests.

I even tried defining BC years using date math, e.g:

facet.date.start: NOW-11000YEARS
facet.date.end: NOW
facet.date.gap: +1000YEAR

and got some weird results:

<int name="8991-06-07T20:30:45-.666Z">0</int>
<int name="7991-06-07T20:30:45-.666Z">0</int>
<int name="6991-06-07T20:30:45-.666Z">0</int>
<int name="5991-06-07T20:30:45-.666Z">0</int>
<int name="4991-06-07T20:30:45-.666Z">0</int>
<int name="3991-06-07T20:30:45-.666Z">0</int>
<int name="2991-06-07T20:30:45-.666Z">0</int>
<int name="1991-06-07T20:30:45-.666Z">0</int>
<int name="0991-06-07T20:30:45-.666Z">0</int>
<int name="0010-06-07T20:30:45-.666Z">0</int>
<int name="1010-06-07T20:30:45-.666Z">1435</int>

Note the - after the seconds. Looks like a bug to me...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文