Displaying Books In Groups Based On Subject
Introduction
This wiki explains that how to display search result based on subject. SB-10221
Problem Statement
Display the books in groups based on subject by using content search API.
Proposed Design
Solution 1:
- Fetch the list of available TextBook for a selected board, medium and grade.
"request": { "mode": "hard", "filters": { "objectType": "Content", "board: ["Karnataka"], "gradeLevel": ["Class 5"], "medium": ["English"] }, "limit": 0, "facets": ["subject"] }
- For each subject returned in the above API response (facets), use the below search API to fetch the content.
"request": { "filters": { "mode": "hard", "objectType": "Content", "contentType": ["TextBook"], "board: ["Karnataka"], "gradeLevel": ["Class 5"], "medium": ["English"], "subject": "evs" }, "limit": 100, "fields": ["name", "appIcon"] }
- In this approach n+1 API call will be there. Here n is number of facets returned for subject.
Solution 2:
- Fetch the list of available TextBook for a selected board, medium and grade.
"request": { "mode": "hard", "filters": { "objectType": "Content", "contentType": ["TextBook"], "board: ["Karnataka"], "gradeLevel": ["Class 5"], "medium": ["English"] }, "limit": 0, "facets": ["subject"] }
- Group the subject locally in GenieSDK.
Solution 2:
- Fetch the list of available TextBook for a selected board, medium and grade by using some wrapper API on the top of search API.
"request": { "mode": "hard", "filters": { "objectType": "Content", "contentType": ["TextBook"], "board: ["Karnataka"], "gradeLevel": ["Class 5"], "medium": ["English"] }, "limit": 0, "facets": ["subject"] }
- This API will return the response groups based on subject.
Swayangjit Parida Rayulu Villa Santhosh Vasabhaktula Mathew Pallan