-
Improvement
-
Resolution: Fixed
-
Minor
-
3.5
-
MOODLE_35_STABLE
-
MOODLE_35_STABLE
-
MDL-61028-master -
The global search API does not permit filtering searches by user id, even though this information is already present in the schema.
This type of search is most useful in collaborative tools, for example if you are trying to find a particular forum post that was written by your tutor and mentioned Marx, but you can't remember which discussion it was in, and you don't want to wade through all the rubbish posted by other students. (Not that it will matter when the revolution comes.)
I propose adding suitable back-end analagous to other search filtering, and a 'User' field (or possibly 'Users', whichever is easier to implement) in the Filter area of the UI.
Detailed description
Selecting users
Users are selected in a Moodle autocomplete field, so you type in some of the name and it will show a list of options. (This is consistent with existing course and search area fields.)
The search works based on initial letters of a user's first name, last name, or full name. For example, you can find Ford Prefect by seaching for 'For', 'Pref', or 'Ford P', but not by searching 'ord'.
For users with the moodle/site:viewuseridentity permission, you can also search on the identity fields selected in admin settings (by default email). These aren't displayed, but you can search on them. (This is probably most useful in large sites where e.g. idnumber is set to a student's ID number, and administrators want to be able to search for a specific student ID exactly.)
Admin users, and anyone with moodle/user:viewdetails at system level, can search all users. Other users can search only users who are enrolled in courses where the current user has moodle/user:viewdetails capability. By default, this means students can only search the names of other students in the same course as them.
Results of the search are shown in normal sort order (as per other such lists of users), which is usually alphabetical by surname, except that if you type an exact match for one of the identity fields then that user will show first. However there is one exception to this standard sort order; if you have chosen a course (or activity within a course) from the Search within dropdown, then users from that course will show first in the list.
The list shows a maximum of 30 users.
Searching
The search feature is straightforward (it will only return results where the userid matches one of the selected users).
One thing to bear in mind is that the userid schema field, on which this depends, is not implemented in all search areas. For example, both forum and glossary implement it as you would expect, but in the case of a wiki page, where the page may have been created by lots of people, there is no userid data. (The userid field accepts only one value.)
- duplicates
-
MDL-53168 user filtering in global search
- Closed
- has been marked as being related by
-
MDL-83932 Global search loses user filters when paginating
- Open
-
MDL-71039 Option valuehtmlcallback is not evaluated when autocomplete is inside a group
- Closed
- is duplicated by
-
MDL-53168 user filtering in global search
- Closed