From: Sebastian Hammer Date: Wed, 17 Jan 2007 15:27:34 +0000 (+0000) Subject: Remove targets with hits < 1 or errors from target termlist X-Git-Tag: stable.27032007~69 X-Git-Url: http://git.indexdata.com/cgi-bin?a=commitdiff_plain;h=47b679560c26472b212ea4b851ad108859e0e9a6;p=pazpar2-moved-to-github.git Remove targets with hits < 1 or errors from target termlist --- diff --git a/src/http_command.c b/src/http_command.c index 114d2ea..86c67d4 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -1,5 +1,5 @@ /* - * $Id: http_command.c,v 1.23 2007-01-17 14:21:29 quinn Exp $ + * $Id: http_command.c,v 1.24 2007-01-17 15:27:34 quinn Exp $ */ #include @@ -165,7 +165,7 @@ static void targets_termlist(WRBUF wrbuf, struct session *se, int num) if (!(ht = hitsbytarget(se, &count))) return; qsort(ht, count, sizeof(struct hitsbytarget), cmp_ht); - for (i = 0; i < count && i < num; i++) + for (i = 0; i < count && i < num && ht[i].hits > 0; i++) { wrbuf_puts(wrbuf, "\n\n"); wrbuf_printf(wrbuf, "%s\n", ht[i].id);