date facet for cck field
| Project: | Apache Solr Search Integration |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Jump to:
I am currently (successfully) using apachesolr for project with custom facet on cck date field.
As the code that I've made is done inside apachesolr module I want to make it separate module (so I can update apachesolr without patchig the code again)
I am using hook for (standard) cck fields hook_apachesolr_cck_fields_alter(&$mappings) and this is enough to get facet.
But to make it work like date facets (for node created and node changed fields) I had to change
function apachesolr_search_add_facet_params(&$params, $query)
and
function apachesolr_search_block($op = 'list', $delta = 0, $edit = array())
There is one more change that I've done. It is in function apachesolr_search_date_range($query, $facet_field) and it is handling dates that are in ISO format (string) in database.
I am attaching diff.
Is there support for additional cck fields that will act like date facets planned (and when)? Is there some plan that I should consider when trying to make support for date facets from cck fields?
I was thinking maybe to automaticly consider using funcionst for date facets if cck field is date or datetime or timestamp type...
Mihajlo
Kontrola
| Attachment | Size |
|---|---|
| recdate.diff | 2.88 KB |

#1
Any chance we can get basic cck date field support in core apachesolr? if not, lets try to clear these blockers. I have not tried the code, but will probably need this soon.
#2
I'm very interested in this. Would this be possible for 1.x-rc4, or will this have to go into 2.x? The patch seems simple enough.
#3
The patch hardcodes the name of the CCK field. There needs to be more abstraction.