Solr Facet 的活动日期
我有一个事件表,它有这样的开始日期和结束日期
==============================================
id | name | start_date | end_date
==============================================
1 | Test Event 1 | 2011-11-20 | 2011-12-20
----------------------------------------------
2 | My Event 2 | 2011-12-05 | 2011-12-26
----------------------------------------------
3 | My Event 3 | 2012-12-26 | 2012-01-11
----------------------------------------------
现在我想要一个像这样的 solr 方面,但我似乎无法正确获取参数。
==================
Dates
------------------
Today [2]
This Week [2]
This Month [2]
Next Month [1]
请注意,该方面必须考虑开始日期和结束日期。有点像组平?
这个的分面参数应该是什么?
预先感谢您的任何帮助。
I have an event table which has start date and end date like this
==============================================
id | name | start_date | end_date
==============================================
1 | Test Event 1 | 2011-11-20 | 2011-12-20
----------------------------------------------
2 | My Event 2 | 2011-12-05 | 2011-12-26
----------------------------------------------
3 | My Event 3 | 2012-12-26 | 2012-01-11
----------------------------------------------
Now I want to have a solr facet which looks like this and i can't seem to get the params right.
==================
Dates
------------------
Today [2]
This Week [2]
This Month [2]
Next Month [1]
Please note that the facet has to consider both start date and end date. Sort of gouping ?
What should be the faceting parameters for this ?
Thanks in advance for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我终于使用基于示例的日光浴室库 Facet Multi Query 使其工作 http:// wiki.solarium-project.org/index.php/V2:Facet_multiquery
我的 Zend 应用程序中的部分看起来像
如果有人想了解更多信息,请告诉我。
这些参数捕获了我到目前为止所需的内容,但尚未进行广泛的测试。
I finally got it working using solarium libraries Facet Multi Query based on the example http://wiki.solarium-project.org/index.php/V2:Facet_multiquery
The part in my Zend App looks like
If anyone wants to know more, please let me know.
These params catch what i needed so far but haven't tested extensively.
你可以把
$startdate.'T01:00:59Z'
$enddate.'T23:59:59Z'
You can put
$startdate.'T01:00:59Z'
$enddate.'T23:59:59Z'