You are here

function _asa_get_indexable_files in Apache Solr Attachments 5

Return all file attachments for a particular node

1 call to _asa_get_indexable_files()
apachesolr_attachments_update_index in ./apachesolr_attachments.module
Hook is called by search.module to add things to the search index. In our case we will search content types and add any CCK type that is a file type that we know how to parse and any uploaded file attachments.

File

./apachesolr_attachments.module, line 202
Provides a file attachment search implementation for use with the Apache Solr module

Code

function _asa_get_indexable_files($node) {
  $files = array();
  if (!empty($node->files)) {
    $files = array_merge($files, $node->files);
  }
  $fields = _asa_get_cck_file_fields();
  foreach ($fields as $field) {
    if (!empty($node->{$field})) {
      $files = array_merge($files, $node->{$field});
    }
  }
  return $files;
}