mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(packages.search): fix default ordering & improve performance
- Use queries more closely aligned to PHP's implementation; removes the need for separate vote/notification queries. - Default sort by popularity Closes #214 Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
e75aa386ea
commit
56bd60559c
7 changed files with 161 additions and 90 deletions
|
@ -656,6 +656,9 @@ def test_rpc_msearch(client: TestClient, user: User, packages: List[Package]):
|
|||
data = response.json()
|
||||
assert data.get("resultcount") == 0
|
||||
|
||||
with db.begin():
|
||||
packages[0].PackageBase.Maintainer = None
|
||||
|
||||
# A missing arg still succeeds, but it returns all orphans.
|
||||
# Just verify that we receive no error and the orphaned result.
|
||||
params.pop("arg")
|
||||
|
@ -663,7 +666,7 @@ def test_rpc_msearch(client: TestClient, user: User, packages: List[Package]):
|
|||
data = response.json()
|
||||
assert data.get("resultcount") == 1
|
||||
result = data.get("results")[0]
|
||||
assert result.get("Name") == "woogly-chungus"
|
||||
assert result.get("Name") == "big-chungus"
|
||||
|
||||
|
||||
def test_rpc_search_depends(client: TestClient, packages: List[Package],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue