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....

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Susurrus’s picture

Subscribing.

Souvent22’s picture

Assigned: Unassigned » Souvent22
FileSize
12.2 KB

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

David Lesieur’s picture

Status: Active » Needs work
Souvent22’s picture

FileSize
15.46 KB

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.

unxposed’s picture

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?

jhodgdon’s picture

Version: 7.x-dev » 8.x-dev

Bumping version

jhodgdon’s picture

Just a note... I realize this will not get into Drupal any time soon... but I took a look at the proposed patch, and I cannot see how this approach would possibly work correctly with pagination.

Really, for search modules to be collected together under unified tabs, they need to be part of the same search query, so that pagination will work correctly. This is (I think) not really possible for user and node searches, but might be possible for searches of nodes and contributed search modules that use the search_index and search_dataset tables.

jhodgdon’s picture

Status: Needs work » Closed (won't fix)

I am closing this as a "won't fix". Individual search plugins do their own queries. It is not possible for the Search module to combine them into one results page.