Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
node system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
7 Dec 2008 at 04:44 UTC
Updated:
4 Mar 2014 at 21:49 UTC
Jump to comment: Most recent
In node module, we have this comment:
// Remove this node from the search index if needed.
// This code is implemented in node module rather than in search module,
// because node module is implementing search module's API, not the other
// way around.
Which precedes a search_wipe() wrapped in if (module_exists('search')) {
I think that it would be cleaner for search to implement hook_nodeapi_delete() and do the search wipe for the node there, rather than having module_exists().
Patch is attached ...
| Comment | File | Size | Author |
|---|---|---|---|
| search-wip.patch | 1.63 KB | kbahey |
Comments
Comment #1
david straussI'm not sure I agree with just moving the functionality to the search module, but I do agree we need looser coupling with the search module.
Comment #2
kbahey commentedThis is not about "just moving".
Rather, hookifying things with nodeapi when a node is deleted, where they really belong.
This way things are cleaner, and done the Drupal way.
Comment #3
david straussIs search intended to only index users and nodes, or is it supposed to be more flexible? If it's supposed to be more flexible, then the proposed change doesn't fix the underlying architectural problem of search needing special code to respond to events for each type of item it indexes. If search exclusively indexes nodes and users, this solution is probably acceptable.
Comment #4
kbahey commentedI don't intend to rearchitect the search module. This patch puts the code where it really belongs, instead of having conditionals in other modules.
By putting this patch in search we are not precluding any future improvements either.
Like you said, decoupling is a good thing.
Comment #5
david strauss@kbahey Agreed.
Comment #7
Jooblay.net commentedWhat is the status of this ticket:) Can we close this...