-
Improvement
-
Resolution: Fixed
-
Minor
-
3.5
-
MOODLE_35_STABLE
-
MOODLE_35_STABLE
-
MDL-58885-master -
At the moment, the global search system does not have group support, i.e. there is no way to store a group id with indexed search data, and then do a search in a way that filters for that group.
It is possible for a module to apply filters on the results, which can include group information. However there is not very efficient in cases where there are a large number of groups. For example, supposing there is a tutor group forum on an course that has 50 tutor groups. If you are a student belonging to one tutor group, then approximately 98% of the search results relating to this forum will be invalid and will get filtered - Solr would have to retrieve 500 results just to display 10 of them.
It should be more efficient to include the group id into the search system and then, in the case of activities in 'separate groups' mode, automatically include only results from groups that the user belongs to, or from courses where they have 'access all groups' permission.
This change will add group support to the search system back-end:
- Search areas can add a group id into results.
- Module search areas can indicate that a particular cm should restrict results to groups the user can access (because it's in separate groups mode).
- The search engine will automatically exclude results for these modules if they are in a group the user doesn't belong to, and the group doesn't have access all groups.
- There is back-end support for searching for results from a specific group id (or ids), but no user interface yet (this is difficult in the current interface; it will be added in a later change).