After seeing the recent introduction of sorting within facets #372336: Allow name sorting of facets, I would also like the ability to reverse the sorting on the date facets so it shows the most recent dates first.

I have attached a patch to move in this direction and it works for me so far.

Comments

cmjns’s picture

Status: Needs work » Needs review
StatusFileSize
new6.09 KB

The patch posted here didn't work for me (unsurprisingly, since it's about a year old). Here's a new patch. The bulk of the work is in apachesolr_date_facet_block(), where sort options are applied. I noticed that the sort options present in every other block were if'd out for the date blocks. I figure this must be because the settings that apply everywhere else don't really apply to the date blocks (i.e., string sorting). The current patch simply re-enables these options, without addressing the presence of extraneous sort options.

I suppose, though I don't see why, that someone actually might want to sort, e.g., by date part names. If so, then all the sort options do apply, after all. But that's outside the scope of this patch.

jpmckinney’s picture

Issue tags: +apachesolr_date

Add tag

jpmckinney’s picture

Title: Allow reverse date sorting of facets » Reverse date sorting of facets
Version: 6.x-2.x-dev » 7.x-1.x-dev
pwolanin’s picture

Project: Apache Solr Search » Facet API
Status: Needs review » Needs work

May be obsolete due to the shift to using Facet API

cpliakas’s picture

Status: Needs work » Fixed
StatusFileSize
new74.48 KB

Facet API supports advanced sorting via the GUI, satisfying the use case posted above as the next release of Apache Solr will leverage Facet API. See the attached screenshot for an example of what the UI provides.

Thanks,
Chris

Status: Fixed » Closed (fixed)
Issue tags: -apachesolr_date

Automatically closed -- issue fixed for 2 weeks with no activity.