CCK fields in Solr not searchable (although present in Solr)

Created on 10 December 2013, over 10 years ago
Updated 8 December 2023, 7 months ago

Hi,
I am so sorry if I am creating a duplicate post, but I have searched and searched, and I can't find anything related to my problem at all. In short, I have found the ways to get the data I need to into Solr (I can view it in the solr admin interface), and I can retrieve the data no problem at all in the results, however, searching on the fields I put into Solr always return zero search results.

I am trying to add custom CCK fields to SOLR, using the code below:

/**
* Implementation of hook_apachesolr_update_index()
*/
function MYMODULE_apachesolr_update_index(&$document, $node, $namespace) {

  if ($node->type == 'the_right_node_type' && $document->entity == 'node')
  {    
    $document->addField('ts_myccktextstring', $the_text_i_set_it_to');
    //quick note: I also did try $document->ts_myccktextstring = $the_text_i_set_it_to';
    //but that didn't work for me at all
  }

}

/**
* Implementation of hook_apachesolr_modify_query()
*/
function MYMODULE_apachesolr_modify_query(&$query, &$params, $caller) {
  $params['fl'] .= ',ts_myccktextstring';
}

I've gone through the schema.xml, and it looks like the dynamic field "ts_*" is indexed and stored, soโ€ฆ.

I've found the following posts from DrupalCon2010: http://sf2010.drupal.org/conference/sessions/apache-solr-search-mastery....
As well as Acquia: http://www.acquia.com/blog/using-apachesolr-index-custom-data

And all the documentation I can find (as far as I can tell) tells me that is all I need to do, so why can't I get any search results when I search on these fields? I should note, it's not just my drupal site that's not returning any results from searches on my custom fields, I get zero results when I search within the Solr interface, too.

I am using Drupal 6.28.

Thank you so much for any help at allโ€ฆI'm out of places to look.

๐Ÿ’ฌ Support request
Status

Closed: outdated

Version

1.8

Component

Code

Created by

๐Ÿ‡จ๐Ÿ‡ฆCanada baby_j

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    I am closing this issue because it is for a Drupal version that is now not supported. Feel free to re-open it, if it is still relevant for a release of the project that is for a supported Drupal version.

Production build 0.69.0 2024