views:

201

answers:

3

I made a private section on a drupal site by writing a module that checks the RERQUEST_URI for the section as well as user role. The issue I am running into now is how to prevent those nodes/views from appearing in the search.

The content types used in the private section are used in other places in the site.

What's the best way to get Druapl search to ignore the content/not index/not display it in search results?

+3  A: 

There is a wonderful article that explains just this on the lullabot site.

It's worth reading the comments to the post too, because people there suggested alternate ways of doing that, also by mean of contrib modules (rather than implementing some hooks in your own code). Code for D6 is in the comment as well.

HTH!

mac
Nice - I've bookmarked that one ;-)
DilbertDave
lullabot pointed me in the right direction. Thanks!
easement
Nice to hear... happy coding then! ;)
mac
A: 

If the content types used within the Private section are also used elsewhere how are you hoping to filter them out of the search results (note that I've not looked at the lullabot article by mac yet).

Basically, if you look at the details of two nodes, one private and one public, what differentiates them?

Note: I'm assuming that you want the nodes to appear to users with access to the Private area but not to 'anonymous' users.

DilbertDave
what differentiates them is the URL path and possibly where they are in the menu. I'm not against adding a taxonomy that only contains a 'private' tag if it'll get me there.
easement
I see - you're wanting to limit the results based on where the user is in the system. If they are in the private area then these nodes will be included but not if they are outside. If that's the case then (at first glance) the lullabot article may get you there.
DilbertDave