Project:The eXtensible Catalog (XC) Drupal Toolkit
Component:Code
Category:feature request
Priority:normal
Assigned:pkiraly
Status:needs review

Issue Summary

Kyushu wants to display two more possible display type of date facet.

First:
2000 to present (690)
1900-1999 (2607)
1800-1899 (58)
Before 1800 (25)
Publication date not specified (45)

Second: various kinds of date ranges:
- Before 1900,
- 1901-1949,
- 1950-1989,
- 1990-1999,
- 2000-2005,
- 2006-2008,
- After 2009

Note: This issue is based on the Skype discussion between Shin and Péter.

Comments

#1

For the first scenario, a possible solution could be to use query facets instead of date facets. A Solr URL, which maps the requested values:

&facet=true
                     // 2000 to present
&facet.query=date_df:[2000-01-01T00:00:00Z TO *]   
                     // 1900-1999
&facet.query=date_df:[1900-01-01T00:00:00Z TO 1999-12-31T23:59:59Z]
                     // 1800-1899
&facet.query=date_df:[1800-01-01T00:00:00Z TO 1899-12-31T23:59:59Z]
                     // Before 1800
&facet.query=date_df:[* TO 1800-01-01T00:00:00Z]
                     // suppose this is a default date when publication date not specified
&facet.query=date_df:0001-01-01T00:00:00Z

I should check how it is displayed in the user interface. I never tested it.

#2

Status:active» needs review

I have created and commited this feature. Needs some review. I attached the screenshots of the admin screen and "in action".

Hope this helps,
Péter

AttachmentSize
extended_date_facet_in_action.jpg 44.12 KB
extended_date_facet.jpg 164.41 KB