From: Dennis Schafroth Date: Mon, 1 Oct 2012 14:16:08 +0000 (+0200) Subject: Implement Solr sorting to internal Sort parameter. X-Git-Tag: v4.2.40~3 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=71d7ffe7ec64adbc129682beef9df3f44bbca756;p=yaz-moved-to-github.git Implement Solr sorting to internal Sort parameter. https://jira.indexdata.com/browse/YAZ-617 --- diff --git a/src/sortspec.c b/src/sortspec.c index 8d1e19c..e09895b 100644 --- a/src/sortspec.c +++ b/src/sortspec.c @@ -415,14 +415,15 @@ int yaz_solr_sortkeys_to_sort_spec(const char *solr_sortkeys, WRBUF w) nmem_strsplitx(nmem, " ", sortspec[i], &arg, &num_arg, 0); if (num_arg != 2) - return 0; + return -1; + + if (!strcasecmp(arg[1],"asc") && + !strcasecmp(arg[1],"desc")) + return -1; if (arg[1][0]) { order = tolower(arg[1][0]); } - if (order != 'a' || order != 'd') - return 0; - if (i) wrbuf_puts(w, " ");