Perhaps we should create a form where people can add a cck facets as an apachesolr filter block. On a site with a lot of fields, it makes the block page bloat too much...

Comments

robertdouglass’s picture

Priority: Minor » Critical

Agree. Checkboxes on the admin page. Tagged for inclusion in 1.0.

pahariwalla’s picture

Assigned: Unassigned » pahariwalla
Status: Active » Needs review
StatusFileSize
new2.23 KB

Hoping that I understand the idea here ...

1) Apachesolr settings has new variable "CCK fields to display as facets". It presents multiple select checkboxes, one for each cck field as returned from apachesolr_cck_fields().

2) apachesolr_block checks against this and only creates a block if the checkbox was checked.

robertdouglass’s picture

This looks good. Here are the nits =)

+      '#description' => t('Select the CCK fields that you want to use as facets.  These will appear as blocks in admin/build/block.'),
+      );

you can make a link to admin/build/block and say something like

t("These will be available as blocks on the !block_administration_page.", array('!block_administration_page', l(t('block administration page'), 'admin/build/block')));

Also, the second line has too much indentation.

Please solicit another review from someone else.

JacobSingh’s picture

I've got one too :)

$cck_facets = variable_get('apachesolr_cck_facets', '');

This should be cck_facets = ('apachesolr_cck_facets', array());

because you are referencing it as an array later, treating it as a string if it is not set will cause an issue.

pahariwalla’s picture

heh heh .. this is very cool guys. thanks. rampin' up, as they say. will not repeat same mistake twice. will not repeat same mistake twice. file new info. will not repeat same mistake twice.

Also been thinking about default values. Should new cck fields default to "checked" ? Should we have an new option for setting "new fields checked"? Am I beating a dead horse while making even more convoluted inline docs?

(as I recently discovered with cck_nodereference nothing shows up in the selector if you don't check off the node types in settings at the bottom of the page)

I'll post a patch after hearing your thoughts on default.

robertdouglass’s picture

+1 for having all new fields default to checked (preserves current behavior). -1 to adding an option to modify that behavior.

pahariwalla’s picture

I second that motion - bidding closes at end of day. Right now I've got to drive down to San Leandro to fight a bogus $250 ticket for stopping in a bus stop at the Bart station.. :-[

robertdouglass’s picture

hehe! Kieran Lal told me about guys he know in the LA area who set their laptops up with voice recognition, and they responded to emails while driving.

pahariwalla’s picture

A little scary when in incapable "hands". better than an in-depth, live, phone conversation. I do love voice recognition.

byw: I had to look the address up on the web, and when I got there in the nick of time, all I saw was a monster juvenial detention center with massive barbed-wire scary fences that keep kids inside and a huge empty parking lot with a small section that had cars all fenced in to keep kids out. So I missed my hearing, and hit rush hour traffic on the way home... bummer all the way around.

meanwhile... back to Funland

pahariwalla’s picture

StatusFileSize
new2.57 KB

Patch includes:

  • groovy link in description
  • proper default value data type (array)
  • new cck fields now default to "checked"

Style question - should:

      $label = db_result(db_query("SELECT label FROM {node_field_instance} WHERE field_name = '%s'", $name));
      $options[$name] = $label;

be written:

      $options[$name] = db_result(db_query("SELECT label FROM {node_field_instance} WHERE field_name = '%s'", $name));

since the variable is not used again?

janusman’s picture

Status: Needs review » Needs work

Patch is failing for current checkout of DRUPAL-5 branch.

% patch -b <apachesolr_281810_limit_cck_facets.patch 
patching file apachesolr.module
Hunk #1 FAILED at 62.
Hunk #2 succeeded at 483 (offset 42 lines).
1 out of 2 hunks FAILED -- saving rejects to file apachesolr.module.rej
pahariwalla’s picture

Status: Needs work » Needs review
StatusFileSize
new2.53 KB

Let's try that again... new patch created against current dev:

// $Id: apachesolr.module,v 1.1.2.38 2008/09/24 18:07:54 robertDouglass Exp $

thanks

asak’s picture

subscribing (and will test...).

JacobSingh’s picture

StatusFileSize
new2.63 KB

I made a slight modification to this patch as currently it would not work if someone added a new CCK field without going back to the settings page.

JacobSingh’s picture

@peter: how is this affected by the new facet handling? Should this be incorporated into a larger framework?

pwolanin’s picture

@Jacob - yes, I think we should postpone/incorporate this iossue into the larger issue of centralizing facet block handling. With that done, at least the performance aspects of this will no longer be a concern. We will still have to figure out the best UI.

David Lesieur’s picture

JacobSingh’s picture

Status: Needs review » Closed (duplicate)

Indeed