You’ll have to nest your searches, so it can be hard to wrap your head around at first.
Final Results = Search Courses [merged with] Search Subjects
Search Courses = repeating group with source set to Search for Peers; field courses contains search for Courses (any field contains input search term):first item
Search Subjects = repeating group with source set to Search for Peers; field courses contains search for Courses (field subject contains input search term)
Part of the difficulty will be that you’re using a plain text search term to find a database thing. It’s easy to find a database thing if you give the search a thing; it’s complex if you’re trying to match a text string.
One option is to use the multidropdown element instead of the search element. You can set the multidropdown’s list of options to dynamic and a search for all courses, then also allow the user to type anything they want. Then use different searches to look for each thing and combine the results.
The courses field is a “list of courses”. The Subject thing doesn’t have a field that contains any courses. So I don’t think you’ll be able to turn up any courses that way.
Earlier you said you want to “search Peer by Course as well as Subject”
So to get a list of Peers based on Subject you’ll have to do a Search For Peers, then Courses [is in] [search for courses (field subject contains search term)]. So the search for Courses will return a list of courses who’s field Subject contains the subject search term. Then the search for Peers will be able to return a list of Peers who’s field Courses appear in the results of the search for Courses.
Build a search for Peers
set the field for Courses like this “contains search for Courses”
Build the search for Courses
set the field for Subjects like this “contains Subject being searched for”
The search for Courses will be evaluated first. It will return a list of courses where the subject field matches the subject you’re searching for. Then the search for Peers can run, and any Peer where the Course field contains one of the results from the Courses search will be in the results.