Last active
November 14, 2017 08:46
-
-
Save BramDriesen/5c1a073bc30741a2e3c732fc2ea66b2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# D7 Search API Solr or apachesolr.module | |
drush --uri=[domain] ev ' | |
// Get Solr. | |
function XX_get_solr() { | |
$solr = false; | |
if (function_exists("apachesolr_get_solr")) { | |
// apachesolr.module | |
$solr = apachesolr_get_solr(); | |
} | |
elseif (function_exists("search_api_server_load")) { | |
// search_api_solr.module | |
$servers = search_api_server_load_multiple(FALSE, array("class" => "acquia_search_service")); | |
foreach ($servers as $server_id => $server_data) { break; } | |
$solr = search_api_server_load($server_id)->getSolrConnection(); | |
} | |
return $solr; | |
} | |
$solr = XX_get_solr(); | |
# EDIT THIS!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
# REALLY! :) | |
## REPLACE "solrfieldname:solrfieldvalue" WITH "*:*" TO DELETE EVERYTHING | |
$solr->deleteByQuery("solrfieldname:solrfieldvalue"); | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment