-
Notifications
You must be signed in to change notification settings - Fork 4
Description
We changed the search apis on open to accept filter parameters instead of an open search query. This will be the api we will be using going forward. For now OCW is using the legacy search api that is separately running on open-discussions. We want to update ocw to use the new apis so we no longer need to support the legacy search.
The bulk of the updates will happen in course-search-utils. Currently course-search-utils
- Keeps track of search facet state
- Keeps the parameters in the url of the search page in sync with the facet state
- Generates the open search query
Now that we are moving to a new api we can get rid of (3) but (1) and (2) is still code that we want to share among all uis that use the search.
The work that needs to be done is
In course-search-utils:
- Get rid of the large amount of code that generates the open search query and replace it with a small function that formats the active facets into get parameters
- Rename the available facets to match the new parameters used by the api. For example the facet formerly known as
type
is nowresource_type
and the facet formerly called 'resource_typeis
content_feature_type`
In ocw-hugo-themes:
- Update the code that displays facets to use use the new facet names
- Update the code that converts search results to a LearningResource object that can be used by course cards to use the new search result format
- Update the code that actually makes the api call to make a get to the new endpoint instead of a post to the old endpoint
To make sure that everything works together the course-search-utils and ocw-hugo-themes work should happen silmultaneously