Solr 日期范围过滤

Solr date range filtering

正在查看 docs

[2000-11-01 TO 2014-12-01] – The specified date range at a day resolution.

当我尝试这样做时,出现 Invalid Date String 错误。

看了其他答案,发现需要用YYYY-MM-DDThh:mm:ssZ格式指定。

这对我有用 - [2000-11-01T00:00:00Z TO 2014-12-01T23:59:59Z]


所以在 start_date 中添加 T00:00:00Z 和在 end_date 中添加 T23:59:59Z 是唯一的选择吗?


编辑:字段类型是 TrieDateField

您链接的文档明确针对 DateRangeField。如果您的字段是其他两种格式之一,TrieDateFieldDatePointField 取决于您使用的 Solr 版本,您必须使用完整的完整格式。这是一个现场实施细节。