| 1 |
<?php |
<?php |
| 2 |
// $Id: apachesolr.admin.inc,v 1.1.2.32.2.6 2009/10/13 06:49:33 claudiucristea Exp $ |
// $Id: apachesolr.admin.inc,v 1.1.2.32.2.7 2009/10/23 11:47:03 claudiucristea Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 406 |
/** |
/** |
| 407 |
* Utility function to delete the index and reset all index counters. |
* Utility function to delete the index and reset all index counters. |
| 408 |
* |
* |
| 409 |
|
* @param $type |
| 410 |
|
* a single content type to be deleted from the index. |
| 411 |
|
* |
| 412 |
* @throws Exception |
* @throws Exception |
| 413 |
*/ |
*/ |
| 414 |
function apachesolr_delete_index() { |
function apachesolr_delete_index($type = NULL) { |
| 415 |
// Instantiate a new Solr object. |
// Instantiate a new Solr object. |
| 416 |
$solr = apachesolr_get_solr(); |
$solr = apachesolr_get_solr(); |
| 417 |
$query = '*:*'; |
if ($type) { |
| 418 |
|
$query = 'type:' . $type; |
| 419 |
|
} |
| 420 |
|
else { |
| 421 |
|
$query = '*:*'; |
| 422 |
|
} |
| 423 |
// Allow other modules to modify the delete query. |
// Allow other modules to modify the delete query. |
| 424 |
// For example, use the site hash so that you only delete this site's |
// For example, use the site hash so that you only delete this site's |
| 425 |
// content: $query = 'hash:' . apachesolr_site_hash() |
// content: $query = 'hash:' . apachesolr_site_hash() |