Lucene/Solr:对已经分面的日期字段进行分面(枢轴分面/树分面/子分面/分层分面)
我完全迷失在链接和 Solr 术语的世界中。我目前有一个日期字段,但如果可能的话,我想“进一步”面对它。 一个例子: 字段:日期 字段:语言
因此,如果我运行此查询:
http://host:port/solr/select/?q="Don Quijote"&sort=date+asc&facet=true&facet.date=date&facet.date.start=2010-09-01T00:00:00Z&facet.date.end=2010-09-04T23:59:59Z&facet.date.gap=%2B1DAY&facet.field=language&facet.mincount=1&start=0&rows=10
我会得到 2 个不同的多面字段:
一个用于“日期”,例如
2010-09-01 (10)
2010-09-02 (4)
2010-09-03 (60)
2010-09 -04 (7)
等
,一个用于“语言”
“英语”(23)
“西班牙语”(34)
“法语”(32)
所以我的问题是:如何将“语言”字段结果合并到每日统计数据中? 我想最后是这样的:
2010-09-01 (10)
'English' (4)
'Spanish' (5)
'French' (1)
2010-09-02 (4)
'English' (1)
'Spanish' (1)
'French' (2)
2010-09-03 (60)
'English' (20)
'Spanish' (20)
'French' (20)
2010-09-04 (7)
'English' (2)
'Spanish' (3)
'French' (1)
这可能吗?我在像枢轴这样的术语中迷失了自己,尝试了facet.tree=date,language
方法,我不确定我正在寻找的是否是“层次结构方面”...... 任何指示或指导(但最重要的是,以及如何使用日期执行此操作的示例)将不胜感激。 谢谢!
一些链接如下:
https://issues.apache.org/jira/browse/SOLR-792
https://issues.apache.org/jira/browse/SOLR-64
http://lucene.472066.n3.nabble.com /Hierarchical-Facets-td474308.html
http://lucene .472066.n3.nabble.com/Hierarchical-faceting-td1123548.html
I am completely lost in a world of links and Solr terms. I currently have a date field which i facet, but i would like to face it 'further' if possible.
An example:
Field: date
Field: language
So if i run this query:
http://host:port/solr/select/?q="Don Quijote"&sort=date+asc&facet=true&facet.date=date&facet.date.start=2010-09-01T00:00:00Z&facet.date.end=2010-09-04T23:59:59Z&facet.date.gap=%2B1DAY&facet.field=language&facet.mincount=1&start=0&rows=10
I get 2 different faceted fields:
One for 'date' like
2010-09-01 (10)
2010-09-02 (4)
2010-09-03 (60)
2010-09-04 (7)
etc
and one for 'language'
'English' (23)
'Spanish' (34)
'French' (32)
So my question is: How can i merge the 'language' field results into daily stats?
I want at the end something like this:
2010-09-01 (10)
'English' (4)
'Spanish' (5)
'French' (1)
2010-09-02 (4)
'English' (1)
'Spanish' (1)
'French' (2)
2010-09-03 (60)
'English' (20)
'Spanish' (20)
'French' (20)
2010-09-04 (7)
'English' (2)
'Spanish' (3)
'French' (1)
Is this possible? I've lost myself in terms like pivot, tried the facet.tree=date,language
approach and i'm not sure if what i'm looking for is the 'hierarchical facet'...
Any pointers or guidance (but most of all, and example of how to do this with dates) will be appreciated.
Thanks!
Some links read:
https://issues.apache.org/jira/browse/SOLR-792
https://issues.apache.org/jira/browse/SOLR-64
http://lucene.472066.n3.nabble.com/Hierarchical-Facets-td474308.html
http://lucene.472066.n3.nabble.com/Hierarchical-faceting-td1123548.html
http://www.craftyfella.com/2010/01/faceting-and-multifaceting-syntax-in.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定日期方面是否可以在facet.tree 补丁中使用。如果您没有那么多语言(或日期),您可以简单地通过以下方式对一个字段中的字段进行索引
,然后仅通过facet.field=date_lang_merge_field对该一个字段进行分面
I'm not sure if date facets can be used in the facet.tree patch. If you haven't that many languages (or dates) you could simply index the fields in one field via
and then facet on that one field only via facet.field=date_lang_merge_field