What am I missing? looking at: ApacheSolrUpdate::update_index()

line 381:

if ($cck_fields && strpos($key, 'field_') === 0) {

the $key variable is never set in this function.

Checking my local index - CCK fields are not added.

Comments

pwolanin’s picture

Status: Active » Fixed
StatusFileSize
new3.96 KB

this seems to work for me for single and multiple value text fields. Committed - please test and report back.

pwolanin’s picture

Status: Fixed » Patch (to be ported)

probably parts of this need to be backported

mikl’s picture

Thanks Peter (and Acquia, i presume), you just saved my day :D

aufumy’s picture

I am interested to know what is the plan regarding cck fields to index. Currently it seems that text fields of widget_types: optionwidgets_select and optionwidgets_buttons are the only cck fields to index, as per function apachesolr_cck_fields().

I am trying to figure out whether my hook implementation of apachesolr_cck_field_mappings is necessary or will become soon outdated.

function mymodule_apachesolr_cck_field_mappings() {
  return array('text' => array('widget_types' => array('text_textfield' => 1)));
}
pwolanin’s picture

Status: Patch (to be ported) » Active

Well, I think that will overwrite the default one. Maybe we need to do the hook invocation differently - as an alter hook.

robertdouglass’s picture

This is broken due to the 'safe' change. The values of the cck fields come out as <p>foo</p> instead of just foo and the facets are thus broken.

pwolanin’s picture

@Robert - could you clarify more please?

You mean $value['safe']?

dreed47’s picture

any update on this? I've got an implementation of this that I'd like to use CCK fields as facets but can't due to this issue. Is there a workaround I can implement until this is fixed?

pwolanin’s picture

Please elaborate on the bug you observe so that we can work o fixing it. Is this bug still present in the beta2 release?

dreed47’s picture

Ok, sorry but maybe I should be posting in a new "support" thread as I'm not totally sure if I'm trying to use the module correctly. I just started looking at the module today so I may not yet fully understand how it's suppose to work.

I've got a CCK-based content type and I was expecting this module (out of the box) to index the CCK-based nodes and that doesn't seem to be happening. (I'm getting other content to index, just not my CCK nodes) Should they be?, or do I need to implement the hook_apachesolr_cck_field_mappings() function to be able to define what CCK fields to index?

Sorry, I just assumed that my CCK nodes were not getting indexed due to some issue related to this bug report.

pwolanin’s picture

All the CCK content should be getting indexed as part of the rendered node body. However, only those fields using optionwidgets will get separate fields in the index and facets out of the box.

pwolanin’s picture

Category: bug » support
Priority: Critical » Normal
mikl’s picture

#11: Is there any kind of hook or interface that will allow us to alter that behavior? While facets do not make much sense for to have for arbitrary numbers, I really need it as a separate field for building range queries…

Just found it under "exposed hooks" on http://drupal.org/project/apachesolr – thanks for making a good API ;)

pwolanin’s picture

not sure whether those comments on the project page are up to date - check the source code for the current implementation

pwolanin’s picture

Status: Active » Closed (fixed)
floretan’s picture

Version: 6.x-1.x-dev » 5.x-1.x-dev
Category: support » bug
Status: Closed (fixed) » Needs review
StatusFileSize
new4.86 KB

We went on a tangent from the original issue, but the indexing issue hasn't been fixed in the Drupal 5.x branch.

Even if there is still a problem if a field value contains HTML (tags are not removed and get displayed in plain text in the facet block), this patch makes it work (which is already an improvement on the current 5.x version).

robertdouglass’s picture

Status: Needs review » Fixed

Committed #16 to DRUPAL-5 with a slight modification. Thanks!

Status: Fixed » Closed (fixed)

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