/**
 * Alters a search query before executing it.
 *
 * @param SearchApiMultiQueryInterface $query
 *   The executed search query.
 */
function hook_search_api_multi_query_alter(SearchApiMultiQueryInterface $query)
{
    $indexes = $query->getIndexes();
    if (isset($indexes['default_node_index'])) {
        $query->condition('default_node_index:author', 0, '!=');
    }
}
/**
 * Lets modules alter a Solr search request for a multi-index search before
 * sending it.
 *
 * Apache_Solr_Service::search() is called afterwards with these parameters.
 * Please see this method for details on what should be altered where and what
 * is set afterwards.
 *
 * @param array $call_args
 *   An associative array containing all four arguments to the
 *   Apache_Solr_Service::search() call ("query", "offset", "limit" and
 *   "params") as references.
 * @param SearchApiMultiQueryInterface $query
 *   The object representing the executed search query.
 */
function hook_search_api_solr_multi_query_alter(array &$call_args, SearchApiMultiQueryInterface $query)
{
    if ($query->getOption('foobar')) {
        $call_args['params']['foo'] = 'bar';
    }
}