Ejemplo n.º 1
0
/**
 * Allows a module to modify the delete query.
 *
 * @param string $query
 *   This is not an instance of DrupalSolrQueryInterface, it is the raw query
 *   that is being sent to Solr. Defaults to "*:*".
 */
function hook_apachesolr_delete_by_query_alter(&$query)
{
    // Use the site hash so that you only delete this site's content.
    if ($query == '*:*') {
        $query = 'hash:' . apachesolr_site_hash();
    } else {
        $query .= ' AND hash:' . apachesolr_site_hash();
    }
}
/**
 * Allows a module to modify the delete query.
 *
 * @param string $query
 *   Defaults to *:*
 */
function hook_apachesolr_delete_index_alter($query)
{
    // use the site hash so that you only delete this site's content
    $query = 'hash:' . apachesolr_site_hash();
}