From: Dennis Schafroth Date: Wed, 19 Sep 2012 14:22:08 +0000 (+0200) Subject: Implement sort-default lookup in search too X-Git-Tag: v1.6.20~15 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=ce825b4ae09b931986cb203fb44da4f05762da97;p=pazpar2-moved-to-github.git Implement sort-default lookup in search too --- 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");