In apachesolr-7.x-1.1 and earlier, a taxonomy field with a cardinality of 1 would have its tid indexed as im_field_foo, and parent tids would be indexed in the same field.

In apachesolr-7.x-1.2 the same field wants to be indexed as is_field_foo, but this is not possible because you can't add the parents to a single value field.

I suggest we should set $field_info['multiple'] = true on taxonomy fields to revert to the earlier behaviour. The alternative is to only index the child tid, but that would mean the document would not be returned in searches for the parent term.

(note for creating a patch: the former change would be in apachesolr_entity_fields or related hook, the latter in apachesolr_term_reference_indexing_callback)

This regression was caused by the patches in http://drupal.org/node/1897556 and http://drupal.org/node/1900036 which change the module from indexing all fields as multi-value, to intelligently choosing to index as a field as single- or multi-value based on the Drupal configuration of the field. This is a significant change that appears to have been committed accidentally. It is probably a worth while change, but it should be prominently mentioned in the release notes for 7.x-1.2 because it means some field prefixes will change, and facets configured for these fields will disappear.

Comments

ianthomas_uk’s picture

Status: Active » Needs review
StatusFileSize
new536 bytes

Here is a patch to make taxonomy_term_reference fields always multiple value again.

ianthomas_uk’s picture

I originally lost the facets from my test environment when I reindexed after upgrading to 7.x-1.2, but they are now back following a reindex with this patch applied.

nick_vh’s picture

makes sense, if someone else can confirm this we can mark it as rtbc

ditcheva’s picture

Status: Needs review » Reviewed & tested by the community

I'm so glad I found this thread. Apachesolr was no longer indexing one of my several indexed vocabularies after the upgrade, and I couldn't find any information on this online. I specifically implemented a search index display that included the problematic vocabulary, but it kept being unindexed.

This patch fixed the issue, and all my terms are now indexed again.

Thank you!

ditcheva’s picture

Sorry - something strange happened above, and it looked like my comment wasn't saved. So I re-typed here only to see it had been posted..

============================

I'm so glad I found this thread!

Just one of my vocabularies (out of several that were getting indexed) stopped being indexed after the upgrade. Because it wasn't being indexed, it stopped appearing as a facet on my search pages.

I even created a custom search index display for my content type and included that term reference field in the search index display - it still didn't get indexed.

This patch finally fixed things for me and all my fields, including that term reference are now back to being indexed.

Thank you!!

pwolanin’s picture

I'm not sure why Nick changed the default to single-valued. I'm wondering if that was a mistake in his patch or commit.

ianthomas_uk’s picture

https://drupal.org/node/1984664 is a duplicate of this issue

pwolanin’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

Robert_W’s picture

Is it possible this issue is back in 7.x-1.4? After the update from 7.x-1.3 to 7.x-1.4 some taxonomy facets are missing, not all are missing but just some.

Robert_W’s picture

Version: 7.x-1.x-dev » 7.x-1.4
Status: Closed (fixed) » Active
mkalkbrenner’s picture

Version: 7.x-1.4 » 7.x-1.2
Status: Active » Closed (fixed)
walker6o9’s picture

I'm having the opposite issue...Taxonomy fields only show up in facets if they are single-value...for unlimited they don't show up at all