In linked field, how to extend search beyond ID

When entering text into linked fields, I’ve noticed that Frappe sometimes searches through just the ID of the linked document but sometimes other relevant fields. For example, notice that the Sales Invoice doctype will search through Customer Name when linking a Customer document:

…but Program Enrollment does not search Student Name when linking a Student document:

Where is this functionality determined?


Could you find the solution to this? I saw this working in v10, I mean you can search using the search_fields but the same isn’t working in v12!

I ended up fixing my issue a different way, but I’m still not quite clear on how search flows are determined.