By gunzip on
Hello,
I was wondering if there is a way to avoid some content from being indexed
(like excluding some node types from search).
Thanks in advance
cheers~
Hello,
I was wondering if there is a way to avoid some content from being indexed
(like excluding some node types from search).
Thanks in advance
cheers~
Comments
Also interested
I have some content types that should not be displayed independently (only in certain views.) Hence I don't want users to be able to get to those contents via search.
How to avoid indexing them?
Theming
The way I achieved this is by adding a condition in the results theming function. There is however a problem with this approach (see below).
This code goes in phptemplate.php.
So really, it doesn't prevent the indexation but it prevents the results from showing up.
There is one serious caveat to this approach: even if an item is not returned, the search results will count it as an item. So, if you use a pager that displays 10 items per page, you may end up with a page that displays 5 results (5 'hidden'), another 3, another none. If anyone has a solution for this - besides hacking the search module and removing the pager - it would definitely be appreciated!
F
Get only empty pages
When I use this function (using 5.7), I get only unpublished results for nodes of all type, even if I only specified one type in the array.
Edit - it's because I need to add the theming - output etc ... thanks!
Here's a solution to this
Here's a solution to this with a patch http://drupal.org/node/111744
Bevan/
And some alternatives...
http://www.lullabot.com/articles/hiding-content-drupals-search-system