With the current apachesolr search results with nodeaccess turned on, group id of a discussion is returned as
* $doc->nodeaccess_og_subscriber or $doc->nodeaccess_og_admin
instead of
* $doc->og_groups or $doc->og_groups_both

Thus when $extra += node_invoke_nodeapi($doc, 'search result'); is called, it shows '0 groups' always.

There is a hook 'apachesolr_process_results' that is run after, where I would like to unset the '0 groups' and process it further. However, the key of '0 groups' is a number. I would prefer if the key of '0 groups' in the 'extra' search results, was something specific such as 'og_msg' to be able to easily change or unset this.

-      return format_plural(count($current_groups['accessible']), '1 group', '@count groups');
+      $msg =  format_plural(count($current_groups['accessible']), '1 group', '@count groups');
+      return array('og_msg' => $msg);
CommentFileSizeAuthor
og_search_results.patch931 bytesaufumy

Comments

moshe weitzman’s picture

Status: Needs review » Fixed

Committed. Seems like every module should do that in this hook. Currently they do not (comment, upload, book, ...).

Thanks for the fine bug report and for working on apachesolr.

Status: Fixed » Closed (fixed)

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