I am using Apache Solr to index a drupal site, and with facet_api enabled I have a set of useful facets available to me, so that I can filter by tag, author etc. I am using facetapi_select to display the facet options as a select (dropdown) instead of a normal list.

Facet API provides a date facet, and when the date facet is displayed as a list it presents the option to filter by Month, eg:

  • June 2015 (3)
  • August 2015 (5)

Unfortunately, when display is set to use the 'select' widget provided by facetapi_select, the month items no longer show up.

I have found a great article describing how to create custom facets, but as this is probably quite a quite common requirement I wonder if I am missing a way to do this more simply.


You can try to use module Date facets

But if it will not help then you can create your own custom field for solr and save timestamp as "month Year" and filter by this value.

It's article how to create your own custom fields for search api http://ygerasimov.com/add-custom-field-search-api-apachesolr-index but I think that the same is possible for apachesolr module

  • Thanks, but I did look at date_facets and it does not display months as above, rather relative time ranges – autopoietic Oct 8 '15 at 13:56
  • I have since realised that the reason Months are not showing up as facets is because I am using the facet_select module. I will add to the question – autopoietic Oct 8 '15 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.