I'm using Drupal 6, Solr 4.9.0 and Apache Solr module v 6.x-3.x. I'm trying to use Solr to index files attached to nodes, but it's not working. I'm using the Solr Attachments module but I know it's not compatible with 6.x-3.x since that uses the new Solr API of the Drupal 7 version.

Here's what I tried to do so far, and you'll have to pardon me if it looks bad because I'm new to the Solr API:

In apachesolr_attachments.module I changed apachesolr_attachments_update_index this is the code in the do while loop:

 $rows = apachesolr_index_get_entities_to_index($env_id, 'node',   $cron_limit);
 $documents = array();
   foreach($rows as $row){
     apachesolr_attachments_add_documents(&$documents, $row->entity_id, 'apachesolr_attachments');
    $success = apachesolr_index_send_to_solr($env_id, $documents);

The function apachesolr_attachments_add_documents is the same, and it populates an array of "documents" that are fed to apachesolr_index_send_to_solr.

During a quick test when I killed the process quickly with a die command after the first cron batch it seemed to work, but letting it run doesn't work. The search results don't return

If there's a better way, I'd appreciate anyone's help in pointing me to it.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.