Dynamic ranking PAZ-869
[pazpar2-moved-to-github.git] / src / http_command.c
index cbe09aa..dc6750d 100644 (file)
@@ -1009,7 +1009,7 @@ static void show_record(struct http_channel *c, struct http_session *s)
 
         if (checksumstr)
         {
-            long v = atol(checksumstr);
+            unsigned v = strtoul(checksumstr, 0, 10);
             for (i = 0; r; r = r->next)
                 if (v == r->checksum)
                     break;
@@ -1211,6 +1211,8 @@ static void cmd_show(struct http_channel *c)
     const char *block = http_argbyname(rq, "block");
     const char *sort = http_argbyname(rq, "sort");
     const char *block_error = http_argbyname(rq, "report");
+    const char *mergekey = http_argbyname(rq, "mergekey");
+    const char *rank = http_argbyname(rq, "rank");
     struct conf_service *service = 0;
 
     struct reclist_sortparms *sp;
@@ -1233,7 +1235,7 @@ static void cmd_show(struct http_channel *c)
         release_session(c, s);
         return;
     }
-    session_sort(s->psession, sp);
+    session_sort(s->psession, sp, mergekey, rank);
 
     status = session_active_clients(s->psession);
 
@@ -1321,6 +1323,8 @@ static void cmd_search(struct http_channel *c)
     const char *startrecs = http_argbyname(rq, "startrecs");
     const char *limit = http_argbyname(rq, "limit");
     const char *sort = http_argbyname(rq, "sort");
+    const char *mergekey = http_argbyname(rq, "mergekey");
+    const char *rank = http_argbyname(rq, "rank");
     enum pazpar2_error_code code;
     const char *addinfo = 0;
     struct reclist_sortparms *sp;
@@ -1353,7 +1357,7 @@ static void cmd_search(struct http_channel *c)
     }
 
     code = session_search(s->psession, query, startrecs, maxrecs, filter, limit,
-                          &addinfo, sp);
+                          &addinfo, sp, mergekey, rank);
     if (code)
     {
         error(rs, code, addinfo);