In hook_search on line 98 there is:

 foreach (module_invoke_all('ranking') as $var => $values) {

There are at least 2 implementations of this hook in core, in node and comment modules.

CommentFileSizeAuthor
#9 hook_ranking_01.patch3.72 KBcwgordon7

Comments

dave reid’s picture

Priority: Normal » Critical

So yeah...we've had this hook undocumented since May 2008. Bumping to critical.

webchick’s picture

Subscribe. :\

webchick’s picture

Also? While we're documenting this, can we please change it to hook_search_ranking()? I can think of lots of things that might be ranked. And this would help alphabetize it with the other search hooks.

mikey_p’s picture

Issue tags: +Novice
cwgordon7’s picture

Assigned: Unassigned » cwgordon7

I'll document the hook. For the sake of neatness, I'll move the hook's renaming into a separate issue.

lakka’s picture

For more info - see http://drupal.org/node/145242

berdir’s picture

Hint: This is currently a node.module specific hook, and not search.module.

#394182: DBTNG search.module would help to make this generic, maybe something like hook_search_ranking_$type.

rfay’s picture

Pinged cwgordon7 by email to find out status of this.

cwgordon7’s picture

Status: Active » Needs review
StatusFileSize
new3.72 KB

Here's a patch.

mikey_p’s picture

Status: Needs review » Reviewed & tested by the community

Very nice ;)

Is there an issue to change the name somewhere else? Both of the other issue linked seem to go in other directions.

berdir’s picture

My *idea* was to move this to search.module and make it more generic, something like hook_search_$type_ranking as it is currently limited to the node search. But the search.module DBTNGify patch is still not commited and I'm not sure if there is time to do this before code freeze.

webchick’s picture

Version: 7.x-dev » 6.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Excellent work!! :D

Committed to HEAD. Marking down to 6.x. Note that this can be committed to contributions/docs/hooks by anyone with CVS access.

cwgordon7’s picture

Version: 6.x-dev » 7.x-dev
Status: Patch (to be ported) » Fixed

Doesn't make much sense to port this to 6.x because the hook doesn't exist there. :)

Status: Fixed » Closed (fixed)
Issue tags: -Novice

Automatically closed -- issue fixed for 2 weeks with no activity.