}
static int targets_termlist_nb(WRBUF wrbuf, struct session *se, int num,
- NMEM nmem)
+ NMEM nmem, int version)
{
struct hitsbytarget *ht;
int count, i;
wrbuf_printf(wrbuf, "<frequency>" ODR_INT_PRINTF "</frequency>\n",
ht[i].hits);
-
+
+ if (version >= 2) {
+ wrbuf_printf(wrbuf, "<records>%d</records>\n", ht[i].records);
+ wrbuf_printf(wrbuf, "<filtered>%d</filtered>\n", ht[i].filtered);
+ }
+
wrbuf_puts(wrbuf, "<state>");
wrbuf_xmlputs(wrbuf, ht[i].state);
wrbuf_puts(wrbuf, "</state>\n");
}
void perform_termlist(struct http_channel *c, struct session *se,
- const char *name, int num)
+ const char *name, int num, int version)
{
int i, j;
NMEM nmem_tmp = nmem_create();
wrbuf_xmlputs(c->wrbuf, tname);
wrbuf_puts(c->wrbuf, "\">\n");
- targets_termlist_nb(c->wrbuf, se, num, c->nmem);
+ targets_termlist_nb(c->wrbuf, se, num, c->nmem, version);
wrbuf_puts(c->wrbuf, "</list>\n");
must_generate_empty = 0;
}