Override creation of separate tab for other modules' invocation of hook_search
markj - April 28, 2008 - 15:46
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | search.module |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Souvent22 |
| Status: | needs work |
Description
Currently (i.e., up to Drupal 6.x), any modules that implement hook_search() have tab created for them that contains the search results produced by that module. It would be useful if this behavior was optional and if the invocation of hook_search() could indicate that its search results should be integrated into the same tab as the one created for node content by search_module. Use case: A number of users of the search_attachments module have requested that search results in node content and in attached or uploaded files be integrated into a single tab. See additional information and context at http://acquia.com/blog/drupals-search-framework-the-execution-a-search#c....

#1
Subscribing.
#2
MINNESOTA SERACH SPRINT
This patch is the *start* of giving some flexibility on the search page. The patch allows one to say if they would like a certain modules search to show up under another tab.
For example, if you set it up so that "users" show up under the "node" search, then when one searches under the "Content" tab, they will also get 'users' form the user search also ( meaning both items are searched at the same time ).
This patch is really part of a much larger picture, but is need to as a "means to and end".
This patch is a work in progress. The known problems with it are:
- Test needs to be completed
- Now that the results are on the same page, the results need to be merged togather via their ranking.
- Can the merged search be done in 1 query?
- Scores from the merge need to be normalized some how
- Some UI issues
- General clean up
#3
#4
Patch has been updated with a first-attempt and inefficient algorithm to merge and normalize the search results (e.g. merge the node and user results together).
Currently the user results do not return a score though. Working on a way to score them w/o relying on a database specific function.
#5
This looks very interesting. Very much needed I think... I desperately need it actually! ! ! Can the users and nodes search not be merged together at all currently in Drupal 6?