Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • A aurweb
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 89
    • Issues 89
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 11
    • Merge requests 11
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Arch LinuxArch Linux
  • aurweb
  • Issues
  • #343
Closed
Open
Issue created Mar 08, 2022 by Mario Oenning@mosonReporter

"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

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking