Drupal - How to remove core search index?

If I'm reading the function correctly, search_reindex won't actually empty the search index - it just tells all modules that use search to start re-indexing content.

Uninstalling and re-installing the search module using the "unistall" tab at admin/modules will empty all of the search tables. You will have to temporarily disable all dependent modules to do this.

Alternately, you can empty these tables using the TRUNCATE mysql command. The tables needing to be emptied are search_dataset, search_index, search_total and search_node_links. You could also empty the tables using a database management tool - just be sure to leave the table structure intact - you want to empty the tables, not delete them.

You will then need to disable core search indexing to prevent the search index from filling back up. In your sites/default/settings.php file, you can add:

$conf['search_cron_limit'] = '0';

to prevent Drupal from adding items back into the index on cron runs (while still leaving the search module intact.)

Tags:

Search

7