openverse-api
openverse-api copied to clipboard
Use `terms` instead of `term`
Problem
In the search controller, when performing filtering for more than one value, we use an array of term queries instead of using terms.
https://github.com/WordPress/openverse-api/blob/6cc0551c639081f895d974b30cc465713d0ce360/api/catalog/api/controllers/search_controller.py#L172-L177
Description
Replace the array of term queries with a singular term query. According to the ES docs, the terms query is functionally identical to term.
Additional context
For an example, a terms query is used just a few lines below in the same file, inside the _exclude_filtered function.
https://github.com/WordPress/openverse-api/blob/6cc0551c639081f895d974b30cc465713d0ce360/api/catalog/api/controllers/search_controller.py#L197
Implementation
- [ ] 🙋 I would be interested in implementing this feature.
raising_hand I would be interested in implementing this feature.
Fixed in #902.