From 71d7ffe7ec64adbc129682beef9df3f44bbca756 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Mon, 1 Oct 2012 16:16:08 +0200 Subject: [PATCH] Implement Solr sorting to internal Sort parameter. https://jira.indexdata.com/browse/YAZ-617 --- src/sortspec.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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, " "); -- 1.7.10.4