X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fhttp_command.c;h=987465348a985493360ac01583047ae9adf9e9b5;hb=646158a86d80e5ef0221ef7d7ce2cfc6ba31eacc;hp=a4f7405b5905d7294ab80389761af815921a77e7;hpb=44981e9f52420f6a42bb1ac55712f74a31d17020;p=pazpar2-moved-to-github.git diff --git a/src/http_command.c b/src/http_command.c index a4f7405..9874653 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -696,7 +696,7 @@ static void write_subrecord(struct record *r, WRBUF w, client_get_database(r->client), PZ_NAME); wrbuf_puts(w, "client)); + wrbuf_xmlputs(w, client_get_id(r->client)); wrbuf_puts(w, "\" "); wrbuf_puts(w, "name=\""); @@ -898,6 +898,7 @@ static void show_records(struct http_channel *c, int active) error(rs, PAZPAR2_MALFORMED_PARAMETER_VALUE, "sort"); release_session(c, s); return; + } @@ -950,13 +951,26 @@ static void cmd_show(struct http_channel *c) struct http_request *rq = c->request; struct http_session *s = locate_session(c); const char *block = http_argbyname(rq, "block"); + const char *sort = http_argbyname(rq, "sort"); + struct reclist_sortparms *sp; int status; if (!s) return; + if (!sort) + sort = "relevance"; + status = session_active_clients(s->psession); + if (!(sp = reclist_parse_sortparms(c->nmem, sort, s->psession->service))) + { + error(c->response, PAZPAR2_MALFORMED_PARAMETER_VALUE, "sort"); + release_session(c, s); + return; + } + search_sort(s->psession, sp->name, sp->increasing); + if (block) { if (!strcmp(block, "preferred") && !session_is_preferred_clients_ready(s->psession) && reclist_get_num_records(s->psession->reclist) == 0)