Solr 多方面日期
根据有关方面的 Apache Solr 文档,我可以使用键,因为:'这可以是当多次使用不同的排除项在同一字段上进行分面时很有帮助。
我需要它们,因为我希望有一个方面可以为我提供“最后一天”、“上周”、“上个月”选项。
但是,当我指定设置了以下选项的查询时:
http://URL/select?
...unrelated...
facet=true&
facet.date={!key=some_key}created&
f.some_key.facet.date.start=NOW/DAY-1DAY&
f.some_key.facet.date.end=NOW/DAY&
f.some_key.facet.date.gap=NOW/DAY+1DAY
...unrelated...
Solr 抱怨:
[异常] => org.apache.solr.common.SolrException: 缺少必需参数: f.created.facet.date.start(或 默认值:facet.date.start)
当我设置facet.date.start或f.created.facet.date.start时,它们将覆盖我的some_key(开始/结束/间隙)的字段,这是无用的,因为我需要多个键...任何人都可以在这里指出正确的方向吗?由于我正在使用的库的限制,这需要在单个查询中完成。
According to the Apache Solr documentation on facets, I can use keys because: 'This can be helpful when faceting on the same field multiple times with different exclusions.'
I need them because I want to have a facet that gives me 'Last day', 'Last week', 'Last month' options.
However, when I specify a query with the following options set:
http://URL/select?
...unrelated...
facet=true&
facet.date={!key=some_key}created&
f.some_key.facet.date.start=NOW/DAY-1DAY&
f.some_key.facet.date.end=NOW/DAY&
f.some_key.facet.date.gap=NOW/DAY+1DAY
...unrelated...
Solr complains about:
[exception] =>
org.apache.solr.common.SolrException:
Missing required parameter:
f.created.facet.date.start (or
default: facet.date.start)
When I set facet.date.start, or f.created.facet.date.start, they will override the fields of my some_key (start/end/gap) and this is useless because I need multiple keys... Can anyone point me in the right direction here? Due to limitations of the library I am using, this needs to be done in a single query.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用分面查询:
You could use facet queries: