Closed (duplicate)
Project:
Drupal core
Version:
6.x-dev
Component:
search.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Sep 2006 at 13:35 UTC
Updated:
16 Jun 2007 at 00:33 UTC
hi
it will be great to have an option to select node types, that will
be excluded from being indexed by the search module,
enky.
Comments
Comment #1
killes@www.drop.org commentedwhat would be the point of that?
Comment #2
enky commentedfor privacy reasons, certian node types like 'resume' should not be visible
to public, in the search results,
Comment #3
killes@www.drop.org commentedif you use a node_access module like node_privacy_by_role then only the allowed results will turn up in searches.
Comment #4
Bairnsfather commentedI have content in nodes that is not restricted to any particular set of users, it's meant to be available to all. But I have created a few node types that support content in other nodes, they are "child" nodes to various "parent" nodes.
These nodes do not contain lots of specific content (text) but place graphics and such via JavaScript and misc URIs, there is also some stock mumbo jumbo about not having JavaScript on and Please turn it on... I thought the built in Search feature of Drupal was very cool until I noticed it was turning up all of those support nodes.
I still think it's cool. I just wished I knew how to tell the Search module interface to ignore certain node types. So for now I just empty the Search tables after I run cron and before backing up. There may be a not-too-hard way to override a function in search.module, but...I'm not at that point yet.
So from my standpoint too, I'd love to see this as a feature, a row/list of all one's nodes next to checkboxes at the bottom of Administer -> Search, or maybe it's easier to program (but harder to administer) Administer -> Content Types -> then set a radio button in each content type to "Index for Search" or "Ignore for Search".
I downloaded and read about "node_privacy_byrole.module" but it doesn't stop the "problem" where it happens, a huge amount of search results for nodes only meant to be accessed by their parent node. One can think of it in terms of efficiency as well. Why weigh the index down with stuff worth overlooking? :-)
btw I'm using the stock search.module with 4.7.3. So I bumped the version down to what I'm using. I guess that's how I'm supposed to do things...
-Drew
Comment #5
Steven commentedThis a new feature and hence won't go in until Drupal 6 (as Drupal 5 is frozen).
However, you can hack this in by overriding the "types" selection. In node_search() in node.module, add the following two lines (change 'book,page,story' to your needs).
This will break the existing type selector though. You can edit node_form_alter() and hide it from the form by commenting out:
Comment #6
enky commentedthanks Steven,
i will try your solution,
Comment #7
Bairnsfather commentedSteven, thanks. I'll see if I can incorporate your modification.
Comment #8
killes@www.drop.org commentedno new features go into 4.7
Comment #9
yched commentedsee D6 patch in http://drupal.org/node/111744