You are here

function apachesolr_attachments_apachesolr_modify_query in Apache Solr Attachments 6

Same name and namespace in other branches
  1. 6.2 apachesolr_attachments.module \apachesolr_attachments_apachesolr_modify_query()

Implementation of hook_apachesolr_modify_query().

File

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

Code

function apachesolr_attachments_apachesolr_modify_query(&$query, &$params, $caller) {

  // Fetch the extra file data on searches.
  if ($caller == 'apachesolr_search') {
    $params['fl'] .= ',ss_filemime,ss_file_node_title,ss_file_node_url';
  }
  elseif ($caller == 'apachesolr_mlt') {

    // Exclude files from MLT results.
    $query
      ->add_filter('entity', 'file', TRUE);
  }
}