From ce825b4ae09b931986cb203fb44da4f05762da97 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Wed, 19 Sep 2012 16:22:08 +0200 Subject: [PATCH] Implement sort-default lookup in search too --- src/http_command.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/http_command.c b/src/http_command.c index 6c5732e..2097eee 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -1278,6 +1278,7 @@ static void cmd_search(struct http_channel *c) enum pazpar2_error_code code; const char *addinfo = 0; struct reclist_sortparms *sp; + struct conf_service *service = 0; if (!s) return; @@ -1294,8 +1295,10 @@ static void cmd_search(struct http_channel *c) release_session(c, s); return; } - if (!sort) - sort = "relevance"; + service = s->psession->service; + if (!sort) { + sort = service->default_sort; + } if (!(sp = reclist_parse_sortparms(c->nmem, sort, s->psession->service))) { error(c->response, PAZPAR2_MALFORMED_PARAMETER_VALUE, "sort"); -- 1.7.10.4