From ffec00d0402efc1b301a18b57c0f739eeb94f048 Mon Sep 17 00:00:00 2001 From: John Ferlito Date: Fri, 27 Mar 2026 12:15:07 +1100 Subject: [PATCH] fix: add relevance sort option to POST /search in OpenAPI spec Add relevance to the sort enum and make it the default for the search endpoint. Documents that the order parameter is ignored when sorting by relevance. --- openapi.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 0ccdb50..4bded31 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -355,15 +355,20 @@ paths: minimum: 0 default: 0 sort: - description: The field on which to sort results (e.g., `id`, `updatedAt`). - example: id + description: | + The field on which to sort results. Defaults to `relevance`, which orders + results by search score (highest first). When set to `relevance`, the + `order` parameter is ignored. Use `id`, `name`, `createdAt`, or + `updatedAt` to sort by a specific field. + example: relevance type: string enum: - id - name - createdAt - updatedAt - default: id + - relevance + default: relevance order: description: | Sort order: @@ -1160,7 +1165,6 @@ components: lng: 150.9 limit: 20 offset: 0 - sort: "updatedAt" order: "desc" SearchResponse: