From: Dennis Schafroth Date: Wed, 11 Apr 2012 14:37:12 +0000 (+0200) Subject: Writed the filter record count as well into bytarget response X-Git-Tag: v1.6.13~65 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=d092cafe2c508ad849d49108e99ce6210e92ca51;p=pazpar2-moved-to-github.git Writed the filter record count as well into bytarget response --- diff --git a/src/http_command.c b/src/http_command.c index e3c0c69..27edb18 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -676,7 +676,11 @@ static void bytarget_response(struct http_channel *c, struct http_session *s, co struct hitsbytarget *ht; struct http_request *rq = c->request; const char *settings = http_argbyname(rq, "settings"); - + const char *protocol_version = http_argbyname(rq, "version"); + int version = 0; + if (protocol_version && strcmp(protocol_version,"")) { + version = atoi(protocol_version); + } ht = get_hitsbytarget(s->psession, &count, c->nmem); if (!cmd_status) /* Old protocol, always ok */ @@ -714,8 +718,9 @@ static void bytarget_response(struct http_channel *c, struct http_session *s, co wrbuf_puts(c->wrbuf, "\n"); } - wrbuf_printf(c->wrbuf, "%d\n", ht[i].records); - + wrbuf_printf(c->wrbuf, "%d\n", ht[i].records - ht[i].filtered); + if (version >= 2) + wrbuf_printf(c->wrbuf, "%d\n"); wrbuf_puts(c->wrbuf, ""); wrbuf_xmlputs(c->wrbuf, ht[i].state); wrbuf_puts(c->wrbuf, "\n");