openverse-api icon indicating copy to clipboard operation
openverse-api copied to clipboard

Use `terms` instead of `term`

Open dhruvkb opened this issue 3 years ago • 1 comments

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.

dhruvkb avatar May 15 '22 08:05 dhruvkb

raising_hand I would be interested in implementing this feature.

ramadanomar avatar Aug 23 '22 19:08 ramadanomar

Fixed in #902.

krysal avatar Sep 20 '22 21:09 krysal