Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
If we want to have a framework that allows for pluggable search solutions we need to have the content and user searches provided by core be optional features. Right now there is no way to turn them off. For D5 there is the core searches module: http://drupal.org/project/coresearches which achieves this with a core patch (two new modules, contentsearch and usersearch are provided). A similar solution should be available in D7.
Comment | File | Size | Author |
---|---|---|---|
#10 | searchsettings.png | 5.38 KB | jhodgdon |
Comments
Comment #1
floretan CreditAttribution: floretan commentedThis is a great idea. I think that the search module's lack of configuration flexibility is one of the reason so few people use its search interface (in favor of contrib modules like views_fast_search).
Comment #2
robertDouglass CreditAttribution: robertDouglass commentedClosed duplicate: http://drupal.org/node/183080
Comment #3
catchArchitecturally it makes sense to have this in separate modules - within the search folder two new ones? Would remove a lot of hard coded stuff from node module which can only be a good thing.
Comment #4
Damien Tournoud CreditAttribution: Damien Tournoud commentedWell actually they are already separated. There is nearly nothing "hardcoded" about the node module into the search module, except from the management of links between nodes, which is a completely different story.
The search interface for nodes is provided by the node module (via
node_form_alter()
), which the search logic is provided bynode_search()
.What you want is to separate the search logic from the user interface. That's look doable with the correct
hook_form_alter()
,hook_validate()
andhook_submit()
logic.Comment #5
robertDouglass CreditAttribution: robertDouglass commented@Damien: Actually, I want more than what you describe. I want to have the search module enabled and have no trace of Drupal's core content search in my installation. Since node is a required module it is impossible to have search module enabled and *not* have node search. Putting all of node module's search functionality in its own module solves this nicely, as can be seen with the coresearches module for D5.
Comment #6
catchI think it's the hardcoding of search module into node module that's the issue rather than the other way 'round. node.module handles queries for search tables etc. Not directly related, but there's module_exists() for comment and statistics in node_search() for ranking as well. Any step to make all this a bit more loosely coupled is very welcome IMO.
Comment #7
David Lesieur CreditAttribution: David Lesieur commentedI'm wondering what the best approach would be here... Should we port Robert's coresearches module to D7, and then rip the equivalent functionality from the core modules when the community is ready for it? Or should we provide a huge patch that does all this at once? I'm afraid that a big patch won't be immediately accepted and will be a bit hard to maintain.
Comment #8
robertDouglass CreditAttribution: robertDouglass commented+1 for porting core searches now.
Comment #9
catchBumping, also this should really be a critical task for Drupal 8.
Comment #10
jhodgdonThis has already been done for Drupal 7 actually. Here's a screen shot from the search settings page (note that I have a contrib search module installed as well).
Comment #11
catchIt's not quite done yet. We still have code in node module which relates directly to searching in SQL etc.
Comment #12
jhodgdonThat seems like a separate issue? The issue here is that search module does not allow you to turn off node/user, and that has been fixed.
Comment #13
catchYou can turn it off in the UI, but you still have the code slugging around in your install, same as #5, so it's not properly decoupled yet. We need some issue for doing this, can we leave this open until one of us finds the duplicate?
Comment #14
jhodgdonAh, I see what you are saying.
Comment #15
jhodgdonComment #16
Jody Lynn#1019966: Rename hook_ranking (with BC layer) is related to this and kind of illustrates the problem as I see it.
Required module node is implementing hook_search_admin and then needs to invoke its own hook, hook_ranking. So then node module is defining this hook_ranking that has to do with search. This is the kind of thing that belongs in search module.
Comment #17
jhodgdonThe idea we're really thinking about for Drupal 8 is a modular approach, where the search module itself would be more of a framework, and other modules would be providers of preprocessing, items to index, indexing, retrieval, and UI. This is being discussed now:
http://groups.drupal.org/node/117274
Comments welcome!
Comment #18
klonos...coming from #233476: Add search by node creation date and the author
I think we should postpone this on #2083717: Convert Search Results to Views (or close it as a duplicate or even make the other issue a META and this one one of its sub-issues).
Comment #19
jhodgdonActually, the intent of this issue, as it is described in the summary, was satisfied a long time ago in Drupal 7 (and is still applicable in Drupal 8). You can turn on/off the different search modules(7) or plugins (8) to your heart's content, so just because you turn on the search module doesn't mean you have to have either node or user searches active.
Comment #20
jhodgdonAnd as a note, the code for search in node/user is now off in a plugin class, so you don't have to incur the burden of loading it unless you have those modules turned on. I really do think the intent of this issue has been satisfied. Yes? The only other thing we could do is to split off node_search and user_search into separate modules, but I don't think it would buy us much in terms of efficiency.