Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'd like to suggest that you consider allowing users to disable searching for each content type available. For example, I run the quotes module, and have over 47,000 qutoes to randomly display. I dont particularly want them indexed simply due to the time and load involved.
This may sound specific to a single users issue however with the upcoming content creation set and flexinode types likely to become popular, others may want to not index certain content types on their sites.
Comments
Comment #1
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedSounds usefull, but new features go into 4.8.
Comment #2
rimshot CreditAttribution: rimshot commentedI vote for this change to the search module. I'm running into this exact same problem right now. Any ideas on how I could not have the cron.php index any of my quotes? Just curious. Keep up the great owrk drupal team. Drupal continues to amaze me with its functionality.
Comment #3
davidtrainer CreditAttribution: davidtrainer commentedupdate and subscribe. I need this too
Comment #4
Thomas Sewell CreditAttribution: Thomas Sewell commentedThis could be done by creating an admin menu similar to that used in the search_config module and using search_wipe as in http://drupal.org/node/84955, although that's probably not the most efficient way. A better way might be to modify the db sql used so that it doesn't select content types with a search permission that isn't set.
Hmmm..... I'm going to need to work up a hack to keep sensitive personal information out of search results on one of my sites. If the results are at all compatible with the general user population, I'll post the code back here.
Comment #5
Thomas Sewell CreditAttribution: Thomas Sewell commentedAccording to the comments, the node.module purposefully doesn't use db_rewrite_sql in order to index everything. That leaves out rewriting the sql in another module unless the core node.module was modified as well.
Another alternative would be to add a hook_update_index function to the cck module, since most custom content types that need to be hidden would likely be cck types anyway.
The only other obvious alternative is to use a theme function to override things.
Comment #6
Thomas Sewell CreditAttribution: Thomas Sewell commentedFor my personal solution, I created a custom module called notsearch that contains the following:
Once activated, run cron.php and those content types will be gone from the search index.
So if you are desperate, create a mini-module and change the type= arguments in the query above to match what you want to exclude ('select distinct Type from node;' is useful to get the exact content name you may need). For the long term, it would be better to have the WHERE clause fed from a variable that is set by a proper admin config form, but this is all I have time for tonight.
When I have more time I may turn it into a proper configurable module.
Comment #7
yched CreditAttribution: yched commentedPlease review D6 patch in http://drupal.org/node/111744