Post Type Relationships in Search Logic

Learn about making the search logic aware of post type relationships.

We have linked teachers and events to a course in the Creating Post Relationships lesson. This relationship should be reflected in the search results too. If a user searches for Artificial Intelligence, not only do we want the results to contain the course itself, but also the teachers and events related to the Artificial Intelligence course. As of now, when the custom REST API responds, the courses array contains a result while the teachers and events arrays are empty.

Get hands-on with 1200+ tech skills courses.