Org Web Adapter

hungryroot/jira/be_7010_add_search_support_to_v2_product_endpoint.org

ID
ef6085b9-d0d1-479b-ac16-804a08c21d65

BE-7010 Add search support to V2 Product endpoint

- source :: https://hungryroot.atlassian.net/browse/BE-7010

- tags :: Hungryroot API Project

- epic :: EP-411 Eng Parking Lot

- sprint :: HR BE Sprint 102

- status :: Status - Complete

Tasks

DONE Add search_text to search_fields on the ProductList view

workprojectep411be7010hungryrootsearchapiv2
ID
0188db3f-6a7a-0d9f-c920-49964f8b2fb5

DONE QA that this works properly

workprojectep411be7010hungryrootsearchapiv2
ID
c29e46ab-d364-41ff-bf2b-6696b1d9ea78

- Note taken on

Background

The v2 Product list endpoint currently exposes a search query parameter in

Swagger (“A search term.”), but the backend search functionality is not actually

wired up. The view is using DRF’s built-in SearchFilter, however search_fields

is not defined on the ProductList view, so no filtering is applied. This ticket

should add the appropriate search_fields configuration so that search behaves as

expected. The implementation should mirror v1 pairing search behavior, filtering

products using a case-insensitive match on search_text (e.g., products =

products.filter(search_text__icontains=term)). Once implemented, verify that the

search parameter in Swagger correctly filters results and add a small test to

prevent regressions.

https://github.com/hungryroot/hungryroot/blob/8a51f7c0c6e5121e19f0b4f8b79e258ab7a5efde/app/services/api/product.py#L441