X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=index%2Fzsets.c;h=15fa83c9934bae3744a0568efa9de0786b319820;hb=5660e317ea2972ea6bb6a4f8a415f71579f71103;hp=69d659075059b7361c2eff1cc801a74a413b4890;hpb=4da0cd2978c9a902be772e95302e6522175402fd;p=idzebra-moved-to-github.git diff --git a/index/zsets.c b/index/zsets.c index 69d6590..15fa83c 100644 --- a/index/zsets.c +++ b/index/zsets.c @@ -1,4 +1,4 @@ -/* $Id: zsets.c,v 1.51 2004-08-06 09:43:03 heikki Exp $ +/* $Id: zsets.c,v 1.52 2004-08-06 10:09:27 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -726,7 +726,7 @@ void resultSetRank (ZebraHandle zh, ZebraSet zebraSet, RSET rset) struct rank_control *rc; struct zset_sort_info *sort_info; const char *rank_handler_name = res_get_def(zh->res, "rank", "rank-1"); - zint cur,tot; + double cur,tot; zint est=-2; /* -2 not done, -1 can't do, >0 actual estimate*/ zint esthits; @@ -781,11 +781,11 @@ void resultSetRank (ZebraHandle zh, ZebraSet zebraSet, RSET rset) rset_pos(rset,rfd,&cur,&tot); if (tot>0) { f=1.0*cur/tot; - est=(zint)(zebraSet->hits/f); + est=(zint)(0.5+zebraSet->hits/f); /* FIXME - round the guess to 3 digits */ logf(LOG_LOG, "Estimating hits (%s) " - ZINT_FORMAT"->%d" - "; "ZINT_FORMAT"->"ZINT_FORMAT, + "%0.1f->%d" + "; %0.1f->"ZINT_FORMAT, rset->control->desc, cur, zebraSet->hits, tot,est);