Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform/offered_by API filtering bugs/inconsistencies #237

Closed
mbertrand opened this issue Nov 20, 2023 · 0 comments · Fixed by #240
Closed

Platform/offered_by API filtering bugs/inconsistencies #237

mbertrand opened this issue Nov 20, 2023 · 0 comments · Fixed by #240
Assignees
Labels
bug Something isn't working

Comments

@mbertrand
Copy link
Member

mbertrand commented Nov 20, 2023

The acceptable values for filtering by offered_by and platform differs between the database and opensearch API endpoints. The database API expects the short code, like "mitpe" while the opensearch API expects the "value", in lowercase, like "professional education".

Also, filtering by platform with the opensearch API doesn't work properly for platforms with multi-word values (like "mitx online") because only the platform code ("mitxonline") is passed on to the search index.

Expected Behavior

Both the database and opensearch API's should have the same options for filtering by platform and offered_by and return the same results.

https://mit-open-rc.odl.mit.edu/api/v1/learning_resources/?platform=mitxonline
https://mit-open-rc.odl.mit.edu/api/v1/learning_resources_search/?platform=mitxonline

https://mit-open-rc.odl.mit.edu/api/v1/learning_resources/?offered_by=mitpe
https://mit-open-rc.odl.mit.edu/api/v1/learning_resources_search/?offered_by=mitpe

Current Behavior

https://mit-open-rc.odl.mit.edu/api/v1/learning_resources/?platform=mitxonline
https://mit-open-rc.odl.mit.edu/api/v1/learning_resources_search/?platform=mitx+online (returning no results)

https://mit-open-rc.odl.mit.edu/api/v1/learning_resources/?offered_by=mitpe
https://mit-open-rc.odl.mit.edu/api/v1/learning_resources_search/?offered_by=professional+education

Possible Solution

  • Decide what we want to provide as platform/offered_by filter options across both API's: the short codes ("mitxonline", "see") with API documentation explaining what each of these codes mean, or the full names (in lower case): "mitx online", "sloan executive education"
  • Based on the above, ensure that the values we are filtering by are actually in the search index and also filtered correctly by the database.
  • This is assuming that Use Opensearch for learning resource API results whenever feasible #189 is still on indefinite hold. But in any case the platform filtering for the opensearch API endpoint needs to be fixed.
  • Both the code and full value for each platform/offerer should be returned in the API results, something like this:
    "platform": {"code": "mitpe", "name": "Professional Education"})
    

Platform and offered_by codes/values shown below:

Screenshot 2023-11-20 at 8 31 11 AM

Screenshot 2023-11-20 at 8 31 06 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant