search

Filtering Search Results On CCK Fields

This is a quick HOWTO on altering the core Search module's database query in Drupal 5.x and 6.x. I think this will be different in 7.x, as there seem to be new, better hooks for manipulating queries, but we're not there yet.

For now, the hook you need is hook_db_rewrite_sql(). This allows you to add JOINs and WHERE clauses to existing SQL queries being generated by other Drupal modules.

Stop Searching

There are times when you don't want people to search for specific content types. For example, you may not want to be obliged to theme a content type which is not supposed to be visible anyway, just in case it surfaces in a search. Or there may be a content type which you specifically do *not* want people to be able to search on.

There are two ways to skin this cat, that I know of at least:

Syndicate content