You are here

function apachesolr_stats_apachesolr_modify_query in Apache Solr Statistics 6

Implementation of hook_apachesolr_modify_query().

Adds debugQuery parameter to Solr call that returns processing time, etc.

File

./apachesolr_stats.module, line 132
Keeps and reports statistics about Apache Solr usage and performance.

Code

function apachesolr_stats_apachesolr_modify_query(&$query, &$params, $caller) {
  if (variable_get('apachesolr_stats_enabled', 0)) {

    // Add the debug query argument.
    // See: http://wiki.apache.org/solr/CommonQueryParameters#head-f45a9396425956a4db8d6478ed6029adfb7b0858
    if ($caller == 'apachesolr_search') {
      $params['debugQuery'] = 'true';
    }
  }
}