[PATCH] Add search_type url parameter

Lukas Fleischer lfleischer at archlinux.org
Thu Jul 2 23:46:00 UTC 2020

Hi Kevin,

Thanks for the patch!

On Tue, 30 Jun 2020 at 19:36:01, Kevin Morris wrote:
> This commit introduces new functionality: When `search_type` is `web`,
> search behavior matches aurweb's HTML search page.
> New parameters: `search_type`
> Valid search_type values: `rpc` (default), `web`
> The `rpc` search type uses the existing legacy search method.
> The `web` search type clontes the web-based aurweb search page's behavior
> as closely as possible (see note at the bottom of this message).
> The following example searches for packages that contain `blah` AND `abc`:
> https://aur.archlinux.org/rpc/?v=5&type=search&search_type=web&arg=blah%20abc
> The legacy method still searches for packages that contain 'blah abc':
> https://aur.archlinux.org/rpc/?v=5&type=search&arg=blah%20abc
> https://aur.archlinux.org/rpc/?v=5&type=search&search_type=rpc&arg=blah%20abc

Before having a look at the implementation, is there any reason the two
search types are called "rpc" and "web" (other than "rpc" is how the RPC
interface used to behave and "web" is how the RPC interface used to
behave)? If not, I think we should choose a different naming that is
more intuitive and self-explanatory.

Going a step further, would it be much more work to instead make the
interface more powerful, use conjunctive search by default and perform
exact matches for phrases put in quotes, such as

    "arch linux" package

matching everything that contains the strings "arch linux" and
"package"? With that, we wouldn't even have to distinguish different
search types (but we may need to bump the API version).

Best regards,

More information about the aur-dev mailing list