Skip to content

Add a search_type filter for exact, contains and startsWith search modes#217

Open
cen1 wants to merge 1 commit intokpcyrd:mainfrom
cen1:feature/package_search_improvements
Open

Add a search_type filter for exact, contains and startsWith search modes#217
cen1 wants to merge 1 commit intokpcyrd:mainfrom
cen1:feature/package_search_improvements

Conversation

@cen1
Copy link
Copy Markdown
Contributor

@cen1 cen1 commented Jan 24, 2026

The current name param returns package by exact match however, I needed a more extended functionality on my FE to search by partial match and a "starts with" for an Alphabet filter.

I could have just changed how the name filter works (make the value a LIKE syntax value for example) but that would break backward compat. Second option was to add a new search param like name_starts_with, but then I decided on a third option to switch between modes and have exact be the default.

Could possibly need to have to name this name_search_type if you'd want to do something similar with another field (version?) but not seeing a use case rn.

Client side:

curl "http://localhost:8484/api/v1/packages/binary?name=nano&search_type=exact" |jq
curl "http://localhost:8484/api/v1/packages/binary?name=ano&search_type=contains" |jq
curl "http://localhost:8484/api/v1/packages/binary?name=nan&search_type=starts_with" |jq

@cen1 cen1 marked this pull request as draft January 24, 2026 21:32
@cen1 cen1 marked this pull request as ready for review February 15, 2026 18:25
@cen1
Copy link
Copy Markdown
Contributor Author

cen1 commented Feb 15, 2026

Added some integration tests, I think it should be g2g.

@cen1 cen1 force-pushed the feature/package_search_improvements branch from 86b6e2d to 0e44986 Compare February 15, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant