date facet for cck field

mihha - August 24, 2009 - 17:43
Project:Apache Solr Search Integration
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

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

AttachmentSize
recdate.diff2.88 KB

#1

moshe weitzman - October 16, 2009 - 06:08

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

ximo - October 20, 2009 - 14:48
Version:6.x-1.0-rc2» 6.x-1.x-dev
Category:support request» feature request

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

jpmckinney - December 1, 2009 - 19:36
Status:active» needs work

The patch hardcodes the name of the CCK field. There needs to be more abstraction.

 
 

Drupal is a registered trademark of Dries Buytaert.