"suggest" API call difference to PHP version
Checklist
-
I confirm that this is an issue with aurweb's code and not a user-uploaded package. -
I have described the bug in complete detail in the Description section. -
I have specified steps in the Reproduction section. -
I have included any logs related to the bug in the Logs section. -
I have included the versions which are affected in the Version(s) section.
Description
Hi guys,
The suggest method returns a different result in the FastAPI implementation:
The PHP one queries with like 'searchterm%'
whereas the python one does like '%searchterm%'
StartsWith vs. Contains...
This has a huge impact on performance as well since the latter one needs to perform a table-scan and can't rely on the index on the "Name" column.
https://gitlab.archlinux.org/archlinux/aurweb/-/blob/master/web/lib/aurjson.class.php#L626
https://gitlab.archlinux.org/archlinux/aurweb/-/blob/master/aurweb/rpc.py#L335
Probably intended though
Reproduction
Run the same query against against both endpoints and compare the results. (F.e. /rpc?v=5&type=suggest&arg=test
)
Version(s)
v6 onwards