From: Adam Dickmeiss Date: Wed, 19 Sep 2007 13:23:35 +0000 (+0000) Subject: Deal with targets that return negative hit counts. X-Git-Tag: PAZPAR2.1.0.4~11 X-Git-Url: http://lists.indexdata.com/cgi-bin?a=commitdiff_plain;h=f17753536a7a1ab86f518b7705ed3a2b3216c0e5;hp=1e6906064f09482ddc3660971f35c9299e3a6da7;p=pazpar2-moved-to-github.git Deal with targets that return negative hit counts. --- diff --git a/debian/changelog b/debian/changelog index 621c569..a339ac9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +pazpar2 (1.0.3-3) unstable; urgency=low + + * Deal with bad hit counts. + + -- Adam Dickmeiss Wed, 19 Sep 2007 15:23:04 +0200 + pazpar2 (1.0.3-2) unstable; urgency=low * Terminate blocking show if active clients reaches zero. diff --git a/src/client.c b/src/client.c index 197c121..048c95c 100644 --- a/src/client.c +++ b/src/client.c @@ -1,4 +1,4 @@ -/* $Id: client.c,v 1.21 2007-09-19 13:00:01 adam Exp $ +/* $Id: client.c,v 1.22 2007-09-19 13:23:35 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -612,7 +612,13 @@ void client_search_response(struct client *cl, Z_APDU *a) if (*r->searchStatus) { cl->hits = *r->resultCount; - se->total_hits += cl->hits; + if (cl->hits < 0) + { + yaz_log(YLOG_WARN, "Target %s returns hit count %d", + cl->database->database->url, cl->hits); + } + else + se->total_hits += cl->hits; if (r->presentStatus && !*r->presentStatus && r->records) { yaz_log(YLOG_DEBUG, "Records in search response %s",