feat(search): add configurable sorting for submission results
All checks were successful
Build and Publish Docker Image / deploy (push) Successful in 1m17s

Introduce a `sort` query parameter in submission search paths and pass it into
store search logic. Matching results can now be ordered by `newest`, `oldest`,
`score_desc`, `score_asc`, `mops_desc`, or `mops_asc`, with invalid values
safely defaulting to `newest`.

Update README and HTTP examples to document the new sort behavior and usage so
clients can control result ordering server-side without extra post-processing.feat(search): add configurable sorting for submission results

Introduce a `sort` query parameter in submission search paths and pass it into
store search logic. Matching results can now be ordered by `newest`, `oldest`,
`score_desc`, `score_asc`, `mops_desc`, or `mops_asc`, with invalid values
safely defaulting to `newest`.

Update README and HTTP examples to document the new sort behavior and usage so
clients can control result ordering server-side without extra post-processing.
This commit is contained in:
2026-04-16 00:05:21 +03:00
parent ec86119088
commit c8323d1b6a
5 changed files with 251 additions and 73 deletions

View File

@@ -1,9 +1,9 @@
GET http://localhost:8080/api/search?text=intel&cpu=13700&thread=multi&platform=windows&intensity=10&durationSecs=30
GET http://localhost:8080/api/search?text=intel&cpu=13700&thread=multi&platform=windows&sort=score_desc&intensity=10&durationSecs=30
###
GET http://localhost:8080/api/search?text=anonymous&thread=single&platform=linux&intensity=1&durationSecs=10
GET http://localhost:8080/api/search?text=anonymous&thread=single&platform=linux&sort=oldest&intensity=1&durationSecs=10
###
GET http://localhost:8080/?page=1&text=lab&cpu=ryzen&thread=multi&platform=windows&intensity=10&durationSecs=20
GET http://localhost:8080/?page=1&text=lab&cpu=ryzen&thread=multi&platform=windows&sort=mops_desc&intensity=10&durationSecs=20